@@ -261,6 +261,7 @@ class Target(object):
261261 other_args .extend (["-Xcc" , "-F" + args .foundation_path ])
262262 import_paths .append (os .path .join (args .foundation_path , "swift" ))
263263 if args .libdispatch_build_dir :
264+ import_paths .append (os .path .join (args .libdispatch_build_dir , 'lib' ))
264265 import_paths .append (os .path .join (args .libdispatch_build_dir , "src" ))
265266 import_paths .append (os .path .join (args .libdispatch_build_dir , "src" , "swift" ))
266267 if args .libdispatch_source_dir :
@@ -579,8 +580,10 @@ class llbuild(object):
579580 link_command .extend (["-L" , self .args .foundation_path ])
580581 if self .args .libdispatch_build_dir :
581582 link_command .extend (['-L' , self .args .libdispatch_build_dir ,
583+ '-L' , os .path .join (self .args .libdispatch_build_dir , 'lib' ),
582584 '-Xlinker' , '-lBlocksRuntime' ])
583- link_command .extend (["-L" , os .path .join (self .args .libdispatch_build_dir , "src" )])
585+ link_command .extend (['-L' , os .path .join (self .args .libdispatch_build_dir , "src" ),
586+ '-L' , os .path .join (self .args .libdispatch_build_dir , 'lib' )])
584587
585588 # Add llbuild link flags.
586589 link_command .extend (llbuild_link_args (self .args ))
@@ -1193,9 +1196,12 @@ def main():
11931196 symlink_force (cf_xml_path , libincludedir )
11941197
11951198 # Add symlinks for dispatch.
1196- symlink_force (os .path .join (args .libdispatch_build_dir , 'libBlocksRuntime.so' ), libswiftdir )
1197- symlink_force (os .path .join (args .libdispatch_build_dir , "src" , "libdispatch.so" ), libswiftdir )
1198- symlink_force (os .path .join (args .libdispatch_build_dir , "src" , "libswiftDispatch.so" ), libswiftdir )
1199+ for library in ['libBlocksRuntime.so' , 'libdispatch.so' , 'libswiftDispatch.so' ]:
1200+ for subdir in ['lib' , 'src' , '' ]:
1201+ path = os .path .join (args .libdispatch_build_dir , subdir , library )
1202+ if os .path .exists (path ):
1203+ symlink_force (path , libswiftdir )
1204+ break
11991205
12001206 # Add swiftmodules.
12011207 for module_file in ["Dispatch.swiftmodule" , "Dispatch.swiftdoc" ]:
0 commit comments