Skip to content

Commit 53d58dd

Browse files
authored
[CMake][MSVC] Wrap more linker flags for IntelLLVM (#557)
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. The approach I used to find these is documented as github gist here: https://gist.github.com/Maetveis/00567488f0d6ff74095d91ed306fafc5
1 parent fccf468 commit 53d58dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ add_llvm_library(${TARGET_NAME} SHARED
300300
if (WIN32)
301301
# Enable compiler generation of Control Flow Guard security checks.
302302
target_compile_options(${TARGET_NAME} PUBLIC "/guard:cf")
303-
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
304-
LINK_FLAGS "/DYNAMICBASE /GUARD:CF")
303+
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY
304+
LINK_OPTIONS "LINKER:/DYNAMICBASE" "LINKER:/GUARD:CF")
305305

306306
elseif(UNIX)
307307
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY

0 commit comments

Comments
 (0)