From: Hauke Mehrtens Date: Sat, 11 Nov 2023 21:18:18 +0000 (+0100) Subject: cmake: Fail if undefined symbols are used X-Git-Url: http://git.openwrt.org/openwrt/feeds.git?a=commitdiff_plain;h=263b9a97cf7e1e2467319c23832b705fc01190b5;p=project%2Fustream-ssl.git 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 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2de6590..f4dca0d 100644 --- a/CMakeLists.txt +++ b/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)