Skip to content

Commit

Permalink
cmake: add -Wl,--no-undefined to GCC linker flags
Browse files Browse the repository at this point in the history
This way unresolved symbols will be detected when linking the shared
library version.
  • Loading branch information
slouken committed Aug 17, 2014
1 parent 569e595 commit 95ced65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Expand Up @@ -340,6 +340,12 @@ if(USE_GCC OR USE_CLANG)
if(HAVE_GCC_WSHADOW)
list(APPEND EXTRA_CFLAGS "-Wshadow")
endif()

set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
check_c_compiler_flag("" HAVE_NO_UNDEFINED)
if(HAVE_NO_UNDEFINED)
list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
endif()
endif()

if(ASSEMBLY)
Expand Down

0 comments on commit 95ced65

Please sign in to comment.