@@ -645,10 +645,6 @@ if run_vendor == 'apple':
645
645
{ 'macosx' : 'macos' , 'darwin' : 'macos' }.get (run_os , run_os )
646
646
)
647
647
648
- config .available_features .add ('libdispatch' )
649
- config .available_features .add ('foundation' )
650
- config .available_features .add ('objc_interop' )
651
-
652
648
config .target_object_format = "macho"
653
649
config .target_shared_library_prefix = 'lib'
654
650
config .target_shared_library_suffix = ".dylib"
@@ -1488,4 +1484,25 @@ if platform.system() == 'Linux':
1488
1484
config .available_features .add ("LinuxDistribution=" + distributor + '-' + release )
1489
1485
lit_config .note ('Running tests on %s-%s' % (distributor , release ))
1490
1486
1487
+ if run_vendor == 'apple' :
1488
+ config .available_features .add ('libdispatch' )
1489
+ config .available_features .add ('foundation' )
1490
+ config .available_features .add ('objc_interop' )
1491
+ else :
1492
+ # TODO(yln): Works with the packaged swift distribution, but not during build.
1493
+ # We need to make libdispatch/foundation available in the test resource directory
1494
+ # or pass along the proper library include paths in the compiler invocations that are used
1495
+ # to build the tests.
1496
+ def has_lib (name ):
1497
+ return False
1498
+
1499
+ if has_lib ('dispatch' ):
1500
+ config .available_features .add ('libdispatch' )
1501
+ else :
1502
+ # TSan runtime requires libdispatch on non-Apple platforms
1503
+ config .available_features .remove ('tsan_runtime' )
1504
+
1505
+ if has_lib ('Foundation' ):
1506
+ config .available_features .add ('foundation' )
1507
+
1491
1508
lit_config .note ("Available features: " + ", " .join (sorted (config .available_features )))
0 commit comments