File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,14 @@ add_custom_command(
3636if (WIN32 )
3737 set (clang_exe ${CMAKE_BINARY_DIR} /bin/clang-cl.exe)
3838 set (SYCL_JIT_RESOURCE_CXX_FLAGS /O2 /std:c++17 /W0)
39- if (CMAKE_BUILD_TYPE MATCHES "Debug" )
40- list (APPEND SYCL_JIT_RESOURCE_CXX_FLAGS /MDd)
41- else ()
42- list (APPEND SYCL_JIT_RESOURCE_CXX_FLAGS /MD )
39+
40+ # Determine if we should use static (/MT) or dynamic (/MD) runtime
41+ set (USE_STATIC_RUNTIME 0)
42+ if (CMAKE_MSVC_RUNTIME_LIBRARY AND NOT CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "DLL" )
43+ set (USE_STATIC_RUNTIME 1)
4344 endif ()
45+
46+ list (APPEND SYCL_JIT_RESOURCE_CXX_FLAGS /M$<IF:${USE_STATIC_RUNTIME} ,T,D>$<$<CONFIG:Debug>:d>)
4447else ()
4548 get_host_tool_path( clang CLANG clang_exe clang_target )
4649 set (SYCL_JIT_RESOURCE_CXX_FLAGS -O2 -Wno-c23-extensions -std=c++17 -fPIC -fvisibility=hidden)
You can’t perform that action at this time.
0 commit comments