diff options
author | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2021-03-07 01:28:15 +0300 |
---|---|---|
committer | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2021-03-07 01:28:15 +0300 |
commit | 8a9077a375abe9f6c70dc131b6c7f13827d51632 (patch) | |
tree | 028c934922a1937b65b4131815e5cafee865dc72 /CMakeLists.txt | |
parent | a723cb6b8f5048bbc09fb1b9fc317145c2b0a4f7 (diff) | |
parent | d269ec49b37dc96e688a87270dcdc7e37f3f00ff (diff) |
Merge branch 'ldflags' into 'master'
Adding linker option -Wl,–no-undefined
Closes #2429
See merge request Remmina/Remmina!2219
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9555ef4b2..44920ea07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,17 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang") endif() endif() +# Figure out no-undefined flag +if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) + set(NO_UNDEFINED_FLAG "-Wl,-undefined,error") +elseif((${CMAKE_SYSTEM_NAME} STREQUAL Linux) OR MINGW) + set(NO_UNDEFINED_FLAG "-Wl,--no-undefined") +else() + # On OpenBSD this seems to cause problems, so we unset it + set(NO_UNDEFINED_FLAG "") +endif() +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${NO_UNDEFINED_FLAG}") + check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(netinet/in.h HAVE_NETINET_IN_H) |