[cmake] add cmake option for WITH_NO_UNDEFINED

This commit is contained in:
akallabeth 2024-12-15 14:59:49 +01:00
parent c4e6837bce
commit db9449aaae
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -313,6 +313,7 @@ if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC)
file(REMOVE ${PROJECT_BINARY_DIR}/foo.txt)
set(CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS_SAVED})
option(WITH_NO_UNDEFINED "compile with -Wl,--no-undefined" OFF)
if(WITH_NO_UNDEFINED)
check_c_compiler_flag(-Wl,--no-undefined no-undefined)