Browse Source

cmake: Fail if undefined symbols are used

Make the linking of the shared library fail when undefined symbols are
used. Linking undefined symbols in a shared library normally works and
the linking of the binary using the shared library fails. We also
compile some example applications and they failed already.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Hauke Mehrtens 5 months ago
parent
commit
263b9a97cf
1 changed files with 1 additions and 0 deletions
  1. 1 0
      CMakeLists.txt

+ 1 - 0
CMakeLists.txt

@@ -10,6 +10,7 @@ ENDIF()
 ADD_DEFINITIONS(-Wno-unused-parameter -Wmissing-declarations)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
 
 IF(MBEDTLS)
   ADD_DEFINITIONS(-DHAVE_MBEDTLS)