Skip to content

Commit

Permalink
[CMake][MSVC] Wrap more linker flags for IntelLLVM
Browse files Browse the repository at this point in the history
My previous pass missed some flags because I used `-Werror=unknown-argument`, but
`/D` and `/G` are accepted by clang (even when only linking), but mean different things
than intended for `link.exe`.
Wrapping the linker with a script revealed these flags.
  • Loading branch information
Maetveis committed Dec 3, 2024
1 parent fccf468 commit d9c48de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ add_llvm_library(${TARGET_NAME} SHARED
if (WIN32)
# Enable compiler generation of Control Flow Guard security checks.
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY
LINK_OPTIONS "LINKER:/DYNAMICBASE" "LINKER:/GUARD:CF")

elseif(UNIX)
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
Expand Down

0 comments on commit d9c48de

Please sign in to comment.