File tree Expand file tree Collapse file tree 4 files changed +25
-29
lines changed Expand file tree Collapse file tree 4 files changed +25
-29
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ if (NOT WIN32 AND NOT CYGWIN)
1919 endif (SYCL_JIT_ENABLE_WERROR)
2020endif ()
2121
22- add_subdirectory (jit-compiler-resource )
2322add_subdirectory (jit-compiler)
2423add_subdirectory (passes)
2524
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ get_host_tool_path( clang CLANG clang_exe clang_target )
2+
3+ set (SYCL_JIT_RESOURCE_CPP "${CMAKE_CURRENT_BINARY_DIR} /resource.cpp" )
4+ # NOTE: has to have a name different from the "default" object target:
5+ set (SYCL_JIT_RESOURCE_OBJ "${CMAKE_CURRENT_BINARY_DIR} /resource.cpp.custom.o" )
6+
7+ add_custom_command (
8+ OUTPUT ${SYCL_JIT_RESOURCE_CPP}
9+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /utils/generate.py --toolchain-dir ${CMAKE_BINARY_DIR} --output ${SYCL_JIT_RESOURCE_CPP} --prefix /sycl-jit-toolchain/
10+ DEPENDS
11+ sycl-headers
12+ # TODO: libdevice
13+ ${CMAKE_CURRENT_SOURCE_DIR} /utils/generate.py
14+ )
15+
16+ # We use C23/C++26's `#embed` to implement this resource creation, and "current"
17+ # CMAKE_CXX_COMPILER might not have support for it. As such, use freshly built
18+ # `clang++` instead.
19+ add_custom_command (
20+ OUTPUT ${SYCL_JIT_RESOURCE_OBJ}
21+ COMMAND ${clang_exe} ${SYCL_JIT_RESOURCE_CPP} -c -o ${SYCL_JIT_RESOURCE_OBJ} -O2 -Wno-c23-extensions -fPIC
22+ DEPENDS ${SYCL_JIT_RESOURCE_CPP}
23+ )
124
225add_llvm_library(sycl-jit
326 lib/translation/JITContext.cpp
@@ -11,6 +34,8 @@ add_llvm_library(sycl-jit
1134 lib/helper/ConfigHelper.cpp
1235 lib/helper/ErrorHelper.cpp
1336
37+ ${SYCL_JIT_RESOURCE_OBJ}
38+
1439 SHARED
1540
1641 DEPENDS
@@ -45,7 +70,6 @@ add_llvm_library(sycl-jit
4570 clangCodeGen
4671 clangTooling
4772 clangSerialization
48- sycl-jit-resource
4973)
5074
5175if (WIN32 )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments