aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-07-16 15:57:40 +0200
committerPierre Ossman <ossman@cendio.se>2020-03-12 12:03:32 +0100
commit79960594551aa32a99506ff87fb0fed5f7bee5eb (patch)
treed5d75588b6f4dcbb29d4cb1b4f1180af488b4f87 /cmake
parentd80817f101d1b3f1a9b1c5ec268f28fffa2d75f9 (diff)
downloadtigervnc-79960594551aa32a99506ff87fb0fed5f7bee5eb.tar.gz
tigervnc-79960594551aa32a99506ff87fb0fed5f7bee5eb.zip
Fix C linking when doing static builds
Diffstat (limited to 'cmake')
-rw-r--r--cmake/StaticBuild.cmake5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake
index d8cdbe6e..43a0786e 100644
--- a/cmake/StaticBuild.cmake
+++ b/cmake/StaticBuild.cmake
@@ -118,7 +118,7 @@ endif()
if(BUILD_STATIC_GCC)
# This ensures that we don't depend on libstdc++ or libgcc_s
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nodefaultlibs")
- set(STATIC_BASE_LIBRARIES "-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic")
+ set(STATIC_BASE_LIBRARIES "")
if(ENABLE_ASAN AND NOT WIN32 AND NOT APPLE)
set(STATIC_BASE_LIBRARIES "${STATIC_BASE_LIBRARIES} -Wl,-Bstatic -lasan -Wl,-Bdynamic -ldl -lm -lpthread")
endif()
@@ -138,5 +138,6 @@ if(BUILD_STATIC_GCC)
else()
set(STATIC_BASE_LIBRARIES "${STATIC_BASE_LIBRARIES} -lgcc -lgcc_eh -lc")
endif()
- set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${STATIC_BASE_LIBRARIES}")
+ set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${STATIC_BASE_LIBRARIES}")
+ set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic ${STATIC_BASE_LIBRARIES}")
endif()