Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions unified-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ set(UR_ADAPTER_HIP_SOURCE_DIR "" CACHE PATH
"Path to external 'hip' adapter source dir")
set(UR_ADAPTER_NATIVE_CPU_SOURCE_DIR "" CACHE PATH
"Path to external 'native_cpu' adapter source dir")
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(UR_DEPENDENTLOADFLAG "0x2000" CACHE STRING
"Value to use for Windows link.exe /DEPENDENTLOADFLAG option")
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(helpers)
Expand Down
4 changes: 2 additions & 2 deletions unified-runtime/cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ function(add_ur_library name)
add_library(${name} ${ARGN})
add_ur_target_compile_options(${name})
add_ur_target_link_options(${name})
if(MSVC)
if(CMAKE_LINKER MATCHES link.exe)
target_link_options(${name} PRIVATE
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:LINKER:/DEPENDENTLOADFLAG:0x2000>
LINKER:/DEPENDENTLOADFLAG:${UR_DEPENDENTLOADFLAG}
)
endif()
endfunction()
Expand Down