Skip to content

Commit d802e23

Browse files
authored
[UR] fix static loader linking with icx (#22490)
1 parent 54ae12b commit d802e23

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

unified-runtime/cmake/helpers.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,24 @@ function(add_ur_target_compile_options name)
116116
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
117117
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
118118
)
119+
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
120+
# icx emits calls to _intel_fast_memcpy/_intel_fast_memset; link
121+
# libirc directly so those symbols resolve.
122+
target_link_libraries(${name} PRIVATE irc)
123+
endif()
119124
if (UR_DEVELOPER_MODE)
120125
target_compile_options(${name} PRIVATE -Werror -Wextra)
121126
endif()
122127
if (CMAKE_BUILD_TYPE STREQUAL "Release")
123128
target_compile_options(${name} PRIVATE -fvisibility=hidden)
124129
endif()
125130
elseif(MSVC)
131+
# Select the dynamic CRT (/MD, /MDd) via the canonical property rather
132+
# than a hardcoded flag, so it can be overridden per target.
133+
set_target_properties(${name} PROPERTIES
134+
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
126135
target_compile_options(${name} PRIVATE
127136
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
128-
/MD$<$<CONFIG:Debug>:d>
129137

130138
/W3
131139
/GS # Enable: Buffer security check

0 commit comments

Comments
 (0)