diff options
author | William R. Dieter <william.r.dieter@intel.com> | 2023-05-25 15:41:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-25 17:17:41 (GMT) |
commit | 9875b1196916572178591b13efa4148f2a8880ef (patch) | |
tree | 2753c7c0965658757cbf0bb68625e8375647ec81 /Modules/Platform | |
parent | cf7b7600c669ea162e0c3960c3e4e3a5d04f3274 (diff) | |
download | CMake-9875b1196916572178591b13efa4148f2a8880ef.zip CMake-9875b1196916572178591b13efa4148f2a8880ef.tar.gz CMake-9875b1196916572178591b13efa4148f2a8880ef.tar.bz2 |
IntelLLVM: Use compiler driver as linker for MODULE libraries too
Since commit 79921fb00c (IntelLLVM: Set linker to compiler driver for
Windows, 2021-10-19, v3.23.0-rc1~127^2) we default to the compiler
driver as linker for executables, shared libraries, and static
libraries. Not doing so for shared modules was an oversight. Copying
the shared library command line for shared modules fixes the problem
(and also is what we do for MSVC).
The MSVC linker is fine for many cases, however it does not support GPU
offload code generated by the IntelLLVM compilers. Using the compiler
driver as linker, or at least a linker that understands the object
format, is required for linking shared modules that use GPU offload
(e.g., with SYCL or OpenMP).
Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-IntelLLVM.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake index 43f5874..eac3f0a 100644 --- a/Modules/Platform/Windows-IntelLLVM.cmake +++ b/Modules/Platform/Windows-IntelLLVM.cmake @@ -54,6 +54,7 @@ macro(__windows_compiler_intel lang) "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> <LINK_LIBRARIES> /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD <LINK_FLAGS> <LINK_LIBRARIES> -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1) # The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1 set(CMAKE_${lang}_CREATE_STATIC_LIBRARY |