Skip to content

Commit ec31e82

Browse files
Jeff Hammondbader
authored andcommitted
[SYCL] Add MacOS file paths to the lit.cfg file for sycl/test (#764)
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]
1 parent a56c1f4 commit ec31e82

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sycl/test/lit.cfg.py

Lines changed: 11 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,15 @@
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+
else:
61+
config.environment['CPATH'] = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1"
62+
config.environment['CPATH'] = os.path.pathsep.join((config.environment['CPATH'], "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"))
63+
config.environment['DYLD_LIBRARY_PATH'] = config.llvm_build_libs_dir
64+
5565
# propagate the environment variable OCL_ICD_FILANEMES to use proper runtime.
5666
if 'OCL_ICD_FILENAMES' in os.environ:
5767
config.environment['OCL_ICD_FILENAMES'] = os.environ['OCL_ICD_FILENAMES']

0 commit comments

Comments
 (0)