Skip to content

Commit

Permalink
Don't replace linker flags set by toolset and user
Browse files Browse the repository at this point in the history
CMAKE_EXE_LINKER_FLAGS is a user-facing cached variable, more so,
possibly initialized by a toolset via CMAKE_EXE_LINKER_FLAGS_INIT.
Augment it instead of overwriting.
  • Loading branch information
kkm000 authored Nov 2, 2021
1 parent bbf4fc5 commit fbb6da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (FORCE_STATIC)
endforeach(flag_var)
else (MSVC)
if (NOT CMAKE_C_COMPILER_ID MATCHES ".*Clang")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -static")
endif ()
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif ()
Expand Down

0 comments on commit fbb6da7

Please sign in to comment.