Skip to content

Commit a15b50a

Browse files
author
Hammond, Jeff R
committed
add MacOS file paths to the lit.cfg file for sycl/test
The hard-coded paths need some attention from someone who understands the structure of Xcode paths. Presumably, there is a way to capture these in a way that survives filesystem reorganization across OSX versions. Slight modifications to the original implementation by @alexbatashev. Signed-off-by: Hammond, Jeff R <[email protected]> Signed-off-by: Alexander Batashev [email protected] (please re-affirm the sign-off that was in your original patch set)
1 parent bb45a4d commit a15b50a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sycl/test/lit.cfg.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
config.environment['LD_LIBRARY_PATH'] = os.path.pathsep.join((config.environment['LD_LIBRARY_PATH'], config.llvm_build_libs_dir))
4141
else:
4242
config.environment['LD_LIBRARY_PATH'] = config.llvm_build_libs_dir
43-
else:
43+
44+
elif platform.system() == "Windows":
4445
config.available_features.add('windows')
4546
if 'LIB' in os.environ:
4647
config.environment['LIB'] = os.path.pathsep.join((config.environment['LIB'], config.llvm_build_libs_dir))
@@ -52,6 +53,16 @@
5253
else:
5354
config.environment['PATH'] = config.llvm_build_bins_dir
5455

56+
elif platform.system() == "Darwin":
57+
# FIXME: surely there is a more elegant way to instantiate the Xcode directories.
58+
if 'CPATH' in os.environ:
59+
config.environment['CPATH'] = os.path.pathsep.join((os.environ['CPATH'], "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"))
60+
config.environment['CPATH'] = os.path.pathsep.join((config.environment['CPATH'], "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"))
61+
else:
62+
config.environment['CPATH'] = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
63+
config.environment['CPATH'] = os.path.pathsep.join((config.environment['CPATH'], "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"))
64+
config.environment['DYLD_LIBRARY_PATH'] = config.llvm_build_libs_dir
65+
5566
# propagate the environment variable OCL_ICD_FILANEMES to use proper runtime.
5667
if 'OCL_ICD_FILENAMES' in os.environ:
5768
config.environment['OCL_ICD_FILENAMES'] = os.environ['OCL_ICD_FILENAMES']

0 commit comments

Comments
 (0)