Skip to content

Commit 7ac8cfb

Browse files
committed
Wrap linker flags on Windows for IntelLLVM
The Intel C++ compiler requires linker flags to be wrapped, because CMake passes them through the compiler driver. Prefix Linker options with `LINKER:`. CMake will transform it to the appropriate flag for the compiler driver: (Nothing for MSVC, clang-cl and /Qoption,link for ICX), so this will work for the other compilers too, and for earlier versions of CMake. Fixes: #757 Signed-off-by: Gergely Meszaros <gergely.meszaros@intel.com>
1 parent 3e4f65f commit 7ac8cfb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmake/helpers.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,17 @@ function(add_umf_target_link_options name)
295295
target_link_options(
296296
${name}
297297
PRIVATE
298-
/DYNAMICBASE
299-
/HIGHENTROPYVA
298+
LINKER:/DYNAMICBASE
299+
LINKER:/HIGHENTROPYVA
300300
$<$<C_COMPILER_ID:MSVC>:/DEPENDENTLOADFLAG:0x2000>
301301
$<$<CXX_COMPILER_ID:MSVC>:/DEPENDENTLOADFLAG:0x2000>
302-
/NXCOMPAT)
302+
LINKER:/NXCOMPAT)
303303
endif()
304304
endfunction()
305305

306306
function(add_umf_target_exec_options name)
307307
if(MSVC)
308-
target_link_options(${name} PRIVATE /ALLOWISOLATION)
308+
target_link_options(${name} PRIVATE LINKER:/ALLOWISOLATION)
309309
endif()
310310
endfunction()
311311

@@ -362,7 +362,7 @@ function(add_umf_library)
362362

363363
if(WINDOWS)
364364
target_link_options(${ARG_NAME} PRIVATE
365-
/DEF:${ARG_WINDOWS_DEF_FILE})
365+
LINKER:/DEF:${ARG_WINDOWS_DEF_FILE})
366366
elseif(LINUX)
367367
target_link_options(${ARG_NAME} PRIVATE
368368
"-Wl,--version-script=${ARG_LINUX_MAP_FILE}")

0 commit comments

Comments
 (0)