File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 99set (SYCL_JIT_VIRTUAL_TOOLCHAIN_ROOT "/sycl-jit-toolchain/" )
1010endif ()
1111
12+ # TODO: libdevice
13+ set (SYCL_JIT_RESOURCE_DEPS sycl-headers clang ${CMAKE_CURRENT_SOURCE_DIR} /utils/generate.py)
14+
15+ if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS)
16+ # Somehow just "libclc" doesn't build "remangled-*" (and maybe whatever else).
17+ list (APPEND SYCL_JIT_RESOURCE_DEPS libclc libspirv-builtins)
18+ endif ()
19+
1220add_custom_command (
1321 OUTPUT ${SYCL_JIT_RESOURCE_CPP}
1422 COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /utils/generate.py --toolchain-dir ${CMAKE_BINARY_DIR} --output ${SYCL_JIT_RESOURCE_CPP} --prefix ${SYCL_JIT_VIRTUAL_TOOLCHAIN_ROOT}
1523 DEPENDS
16- sycl-headers # include/sycl
17- libclc # lib/clc
18- clang # lib/clang
19- # TODO: libdevice
20- ${CMAKE_CURRENT_SOURCE_DIR} /utils/generate.py
24+ ${SYCL_JIT_RESOURCE_DEPS}
2125)
2226
2327# We use C23/C++26's `#embed` to implement this resource creation, and "current"
@@ -34,6 +38,13 @@ if (WIN32)
3438else ()
3539 get_host_tool_path( clang CLANG clang_exe clang_target )
3640 set (SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions -std=c++17 -fPIC -fvisibility=hidden)
41+
42+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin" )
43+ # Hack based on the information at
44+ # https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html
45+ execute_process (COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE SYCL_JIT_OSX_SYSROOT)
46+ list (APPEND SYCL_JIT_RESOURCE_CXX_FLAGS -isysroot ${SYCL_JIT_OSX_SYSROOT} )
47+ endif ()
3748endif ()
3849
3950add_custom_command (
You can’t perform that action at this time.
0 commit comments