Skip to content

Commit da51f6b

Browse files
One more try
1 parent 51f3828 commit da51f6b

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

sycl-jit/jit-compiler/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
get_host_tool_path( clang CLANG clang_exe clang_target )
1+
22

33
set(SYCL_JIT_RESOURCE_CPP "${CMAKE_CURRENT_BINARY_DIR}/resource.cpp")
44
set(SYCL_JIT_RESOURCE_OBJ "${CMAKE_CURRENT_BINARY_DIR}/resource.cpp.o")
@@ -15,13 +15,19 @@ add_custom_command(
1515
# We use C23/C++26's `#embed` to implement this resource creation, and "current"
1616
# CMAKE_CXX_COMPILER might not have support for it. As such, use freshly built
1717
# `clang++` instead.
18-
set(SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions)
19-
if (LLVM_ENABLE_PIC)
20-
list(APPEND SYCL_JIT_RESOURCE_CXX_FLAGS -fPIC)
21-
endif()
22-
23-
if (NOT WIN32)
24-
list(APPEND SYCL_JIT_RESOURCE_CXX_FLAGS -fvisibility=hidden)
18+
set(SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions -std=c++17)
19+
20+
if (WIN32)
21+
set(clang_exe ${CMAKE_BINARY_DIR}/bin/clang-cl.exe)
22+
set(SYCL_JIT_RESOURCE_CXX_FLAGS /O2 /std:c++17 /W0)
23+
if (CMAKE_BUILD_TYPE MATCHES "Debug")
24+
list(APPEND SYCL_JIT_RESOURCE_CXX_FLAGS /MDd)
25+
else()
26+
list(APPEND SYCL_JIT_RESOURCE_CXX_FLAGS /MD)
27+
endif()
28+
else()
29+
get_host_tool_path( clang CLANG clang_exe clang_target )
30+
set(SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions -std=c++17 -fPIC -fvisibility=hidden)
2531
endif()
2632

2733
add_custom_command(

sycl-jit/jit-compiler/utils/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def process_dir(dir):
3838
out.write(
3939
f"""
4040
{{
41-
{{"{args.prefix}{os.path.relpath(file_path, toolchain_dir)}"}} ,
41+
{{"{args.prefix}{os.path.relpath(file_path, toolchain_dir).replace(os.sep, "/")}"}} ,
4242
[]() {{
4343
static const char data[] = {{
4444
#embed "{file_path}"

0 commit comments

Comments
 (0)