diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index a396c84a95863..a6d006a8a78b0 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -126,14 +126,18 @@ # Configure LD_LIBRARY_PATH or corresponding os-specific alternatives if platform.system() == "Linux": config.available_features.add("linux") - llvm_config.with_system_environment(["LD_LIBRARY_PATH", "LIBRARY_PATH", "CPATH"]) + llvm_config.with_system_environment( + ["LD_LIBRARY_PATH", "LIBRARY_PATH", "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH"] + ) llvm_config.with_environment( "LD_LIBRARY_PATH", config.sycl_libs_dir, append_path=True ) elif platform.system() == "Windows": config.available_features.add("windows") - llvm_config.with_system_environment(["LIB", "CPATH", "INCLUDE"]) + llvm_config.with_system_environment( + ["LIB", "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH", "INCLUDE"] + ) llvm_config.with_environment("LIB", config.sycl_libs_dir, append_path=True) llvm_config.with_environment("PATH", config.sycl_libs_dir, append_path=True) llvm_config.with_environment( @@ -142,14 +146,19 @@ elif platform.system() == "Darwin": # FIXME: surely there is a more elegant way to instantiate the Xcode directories. - llvm_config.with_system_environment("CPATH") + llvm_config.with_system_environment(["C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH"]) llvm_config.with_environment( - "CPATH", + "CPLUS_INCLUDE_PATH", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", append_path=True, ) llvm_config.with_environment( - "CPATH", + "C_INCLUDE_PATH", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", + append_path=True, + ) + llvm_config.with_environment( + "CPLUS_INCLUDE_PATH", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", append_path=True, ) @@ -537,9 +546,9 @@ def open_check_file(file_name): "%sycl_options", " " + os.path.normpath(os.path.join(config.sycl_libs_dir + "/../lib/sycl8.lib")) - + " /I" + + " -Xclang -isystem -Xclang " + config.sycl_include - + " /I" + + " -Xclang -isystem -Xclang " + os.path.join(config.sycl_include, "sycl"), ) ) @@ -555,9 +564,9 @@ def open_check_file(file_name): ( "%sycl_options", (" -lsycl8" if platform.system() == "Windows" else " -lsycl") - + " -I" + + " -isystem " + config.sycl_include - + " -I" + + " -isystem " + os.path.join(config.sycl_include, "sycl") + " -L" + config.sycl_libs_dir, diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index dfe1e6a231616..47f6e1e007a72 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -89,14 +89,19 @@ elif platform.system() == "Darwin": # FIXME: surely there is a more elegant way to instantiate the Xcode directories. - llvm_config.with_system_environment("CPATH") + llvm_config.with_system_environment(["C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH"]) llvm_config.with_environment( - "CPATH", + "CPLUS_INCLUDE_PATH", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1", append_path=True, ) llvm_config.with_environment( - "CPATH", + "C_INCLUDE_PATH", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", + append_path=True, + ) + llvm_config.with_environment( + "CPLUS_INCLUDE_PATH", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/", append_path=True, )