cmake: add -Wl,--no-undefined to GCC linker flags

This way unresolved symbols will be detected when linking the shared
library version.
This commit is contained in:
Sam Lantinga 2014-08-17 13:15:45 -07:00
parent 3c747234b3
commit a8d9c26db2

View file

@ -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)