Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make /DEPENDENTLOADFLAG value configurable #2235

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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()

# There's little reason not to generate the compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
4 changes: 2 additions & 2 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,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>:/DEPENDENTLOADFLAG:0x2000>
LINKER:/DEPENDENTLOADFLAG:${UR_DEPENDENTLOADFLAG}
)
endif()
endfunction()
Expand Down
Loading