Skip to content

Commit

Permalink
Merge pull request #2179 from Maetveis/wrap_icx_linker_flags
Browse files Browse the repository at this point in the history
Wrap linker flags on Windows for IntelLLLVM
  • Loading branch information
callumfare authored Nov 12, 2024
2 parents 2eae687 + 9339e37 commit 9a209aa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ function(add_ur_target_link_options name)
endif()
elseif(MSVC)
target_link_options(${name} PRIVATE
/DYNAMICBASE
/HIGHENTROPYVA
/NXCOMPAT
LINKER:/DYNAMICBASE
LINKER:/HIGHENTROPYVA
LINKER:/NXCOMPAT
)
endif()
endfunction()

function(add_ur_target_exec_options name)
if(MSVC)
target_link_options(${name} PRIVATE
/ALLOWISOLATION
LINKER:/ALLOWISOLATION
)
endif()
endfunction()
Expand All @@ -159,7 +159,7 @@ function(add_ur_library name)
add_ur_target_link_options(${name})
if(MSVC)
target_link_options(${name} PRIVATE
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:/DEPENDENTLOADFLAG:0x2000>
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:LINKER:/DEPENDENTLOADFLAG:0x2000>
)
endif()
endfunction()
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function(add_ur_adapter name)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../adapter.def.in ${ADAPTER_VERSION_SCRIPT} @ONLY)
set_target_properties(${name} PROPERTIES
LINK_FLAGS "/DEF:${ADAPTER_VERSION_SCRIPT}"
LINK_OPTIONS "LINKER:/DEF:${ADAPTER_VERSION_SCRIPT}"
)
elseif(APPLE)
target_compile_options(${name} PRIVATE "-fvisibility=hidden")
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if(UR_BUILD_ADAPTER_L0)

if (WIN32)
# 0x800: Search for the DLL only in the System32 folder
target_link_options(ur_adapter_level_zero PRIVATE /DEPENDENTLOADFLAG:0x800)
target_link_options(ur_adapter_level_zero PRIVATE LINKER:/DEPENDENTLOADFLAG:0x800)
endif()

target_link_libraries(ur_adapter_level_zero PRIVATE
Expand Down Expand Up @@ -194,7 +194,7 @@ if(UR_BUILD_ADAPTER_L0_V2)

if (WIN32)
# 0x800: Search for the DLL only in the System32 folder
target_link_options(ur_adapter_level_zero_v2 PUBLIC /DEPENDENTLOADFLAG:0x800)
target_link_options(ur_adapter_level_zero_v2 PUBLIC LINKER:/DEPENDENTLOADFLAG:0x800)
endif()

target_link_libraries(ur_adapter_level_zero_v2 PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion source/loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (MSVC)
set(LOADER_VERSION_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/ur_loader.def)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/loader.def.in ${LOADER_VERSION_SCRIPT} @ONLY)
set_target_properties(ur_loader PROPERTIES
LINK_FLAGS "/DEF:${LOADER_VERSION_SCRIPT}"
LINK_OPTIONS "LINKER:/DEF:${LOADER_VERSION_SCRIPT}"
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(TARGET_LIBNAME libur_loader_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
Expand Down

0 comments on commit 9a209aa

Please sign in to comment.