7878 if platform .system () == 'Windows' :
7979 sdkroot = os .getenv ('SDKROOT' , None )
8080 if sdkroot :
81- swift_exec .extend (['-sdk' , sdkroot ])
81+ swift_exec .extend (['-sdk' , '"' + sdkroot + '"' ])
8282 swift_exec .extend (['-Xlinker' , '-nodefaultlib:libcmt' ])
8383 else :
8484 swift_exec .extend ([
@@ -88,42 +88,36 @@ else:
8888 '-Xlinker' , '-rpath' , '-Xlinker' , os .path .join (foundation_dir , 'Sources' , 'FoundationNetworking' ),
8989 '-Xlinker' , '-rpath' , '-Xlinker' , os .path .join (foundation_dir , 'Sources' , 'FoundationXML' ),
9090 '-Xlinker' , '-rpath' , '-Xlinker' , os .path .join (foundation_dir , 'lib' ),
91+ '-L' , foundation_dir ,
92+ '-L' , os .path .join (foundation_dir , 'Foundation' ),
93+ '-L' , os .path .join (foundation_dir , 'Sources' , 'Foundation' ),
94+ '-L' , os .path .join (foundation_dir , 'Sources' , 'FoundationNetworking' ),
95+ '-L' , os .path .join (foundation_dir , 'Sources' , 'FoundationXML' ),
96+ '-L' , os .path .join (foundation_dir , 'lib' ),
97+ '-I' , foundation_dir ,
98+ '-I' , os .path .join (foundation_dir , 'swift' ),
99+ '-I' , os .path .join (foundation_dir , '_CModulesForClients' ),
100+ '-Xcc' , '-F' , '-Xcc' , foundation_dir ,
91101 ])
92- swift_exec .extend ([
93- '-L' , foundation_dir ,
94- '-L' , os .path .join (foundation_dir , 'Foundation' ),
95- '-L' , os .path .join (foundation_dir , 'Sources' , 'Foundation' ),
96- '-L' , os .path .join (foundation_dir , 'Sources' , 'FoundationNetworking' ),
97- '-L' , os .path .join (foundation_dir , 'Sources' , 'FoundationXML' ),
98- '-L' , os .path .join (foundation_dir , 'lib' ),
99- '-I' , foundation_dir ,
100- '-I' , os .path .join (foundation_dir , 'swift' ),
101- '-I' , os .path .join (foundation_dir , '_CModulesForClients' ),
102- '-Xcc' , '-F' , '-Xcc' , foundation_dir ,
103- ])
104-
105- # We also need to link swift-corelibs-libdispatch, if
106- # swift-corelibs-foundation is using it.
107- libdispatch_src_dir = os .getenv ('LIBDISPATCH_SRC_DIR' )
108- libdispatch_build_dir = os .getenv ('LIBDISPATCH_BUILD_DIR' )
109- libdispatch_overlay_dir = os .getenv ('LIBDISPATCH_OVERLAY_DIR' )
110- if ((libdispatch_src_dir is not None )
111- and (libdispatch_build_dir is not None )
112- and (libdispatch_overlay_dir is not None )):
113- swift_exec .extend ([
114- '-Xcc' , '-fblocks' ,
115- '-I' , libdispatch_src_dir ,
116- '-I' , libdispatch_overlay_dir ,
117- '-I' , os .path .join (libdispatch_overlay_dir , 'swift' ),
118- '-L' , libdispatch_build_dir ,
119- '-L' , os .path .join (libdispatch_build_dir , 'src' ),
120- '-L' , os .path .join (libdispatch_build_dir , 'src' , 'BlocksRuntime' ),
121- '-L' , os .path .join (libdispatch_build_dir , 'src' , 'swift' ),
122- '-vfsoverlay' , os .path .join (libdispatch_build_dir , 'dispatch-vfs-overlay.yaml' ),
123- ])
124102
125- if platform .system () != 'Windows' :
103+ # We also need to link swift-corelibs-libdispatch, if
104+ # swift-corelibs-foundation is using it.
105+ libdispatch_src_dir = os .getenv ('LIBDISPATCH_SRC_DIR' )
106+ libdispatch_build_dir = os .getenv ('LIBDISPATCH_BUILD_DIR' )
107+ libdispatch_overlay_dir = os .getenv ('LIBDISPATCH_OVERLAY_DIR' )
108+ if ((libdispatch_src_dir is not None )
109+ and (libdispatch_build_dir is not None )
110+ and (libdispatch_overlay_dir is not None )):
126111 swift_exec .extend ([
112+ '-Xcc' , '-fblocks' ,
113+ '-I' , libdispatch_src_dir ,
114+ '-I' , libdispatch_overlay_dir ,
115+ '-I' , os .path .join (libdispatch_overlay_dir , 'swift' ),
116+ '-L' , libdispatch_build_dir ,
117+ '-L' , os .path .join (libdispatch_build_dir , 'src' ),
118+ '-L' , os .path .join (libdispatch_build_dir , 'src' , 'BlocksRuntime' ),
119+ '-L' , os .path .join (libdispatch_build_dir , 'src' , 'swift' ),
120+ '-vfsoverlay' , os .path .join (libdispatch_build_dir , 'dispatch-vfs-overlay.yaml' ),
127121 '-Xlinker' , '-rpath' , '-Xlinker' , libdispatch_build_dir ,
128122 ])
129123
0 commit comments