Skip to content

Commit 67874ad

Browse files
committed
[cmake] When the cmake generator we are using is Xcode, make sure to add the bin directory generated by Xcode to the lit test path so that FileCheck can be found when testing.
1 parent e236b68 commit 67874ad

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/lit.site.cfg.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ if "@SWIFT_OPTIMIZED@" == "TRUE":
6464
if "@SWIFT_HAVE_WORKING_STD_REGEX@" == "FALSE":
6565
config.available_features.add('broken_std_regex')
6666

67+
if "@CMAKE_GENERATOR@" == "Xcode":
68+
xcode_bin_dir = os.path.join(config.llvm_obj_root, "@LLVM_BUILD_TYPE@",
69+
'bin')
70+
lit_config.note('Adding to path: ' + xcode_bin_dir)
71+
config.environment['PATH'] = \
72+
os.path.pathsep.join((xcode_bin_dir, config.environment['PATH']))
73+
6774
# Let the main config do the real work.
6875
if config.test_exec_root is None:
6976
config.test_exec_root = os.path.dirname(os.path.realpath(__file__))

validation-test/lit.site.cfg.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ else:
5656
if "@SWIFT_OPTIMIZED@" == "TRUE":
5757
config.available_features.add("optimized_stdlib")
5858

59+
if "@CMAKE_GENERATOR@" == "Xcode":
60+
xcode_bin_dir = os.path.join(config.llvm_obj_root, "@LLVM_BUILD_TYPE@",
61+
'bin')
62+
lit_config.note('Adding to path: ' + xcode_bin_dir)
63+
config.environment['PATH'] = \
64+
os.path.pathsep.join((xcode_bin_dir, config.environment['PATH']))
65+
5966
# Let the main config do the real work.
6067
config.test_exec_root = os.path.dirname(os.path.realpath(__file__))
6168
lit_config.load_config(config, "@SWIFT_SOURCE_DIR@/validation-test/lit.cfg")

0 commit comments

Comments
 (0)