Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c7bca5

Browse files
committed
Fix MSVC cross compilation
Currently, the DefaultCFlags.cmake overrides the CMAKE_STATIC_LINKER_FLAGS to suppress linker warnings about files with no symbols defined. This has the side effect of breaking MSVC cross compilation (where CMAKE_STATIC_LINKER_FLAGS is used to specify the /MACHINE:ARCH flag) This commit make sure we append to CMAKE_STATIC_LINKER_FLAGS instead of replacing its values
1 parent 338e6fb commit 4c7bca5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/DefaultCFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if(MSVC)
5656
set(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /O1 /Oy /GL /Gy ${CRT_FLAG_RELEASE}")
5757

5858
# /IGNORE:4221 - Ignore empty compilation units
59-
set(CMAKE_STATIC_LINKER_FLAGS "/IGNORE:4221")
59+
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
6060

6161
# /DYNAMICBASE - Address space load randomization (ASLR)
6262
# /NXCOMPAT - Data execution prevention (DEP)

0 commit comments

Comments
 (0)