build: Pass -Wl,--no-undefined when linking

This commit is contained in:
Ryan Pavlik 2019-12-03 13:05:02 -06:00 committed by Jakob Bornecrantz
parent 6d60227e06
commit 60460c9c5e

View file

@ -170,6 +170,11 @@ endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter")
if(NOT MSVC)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
# Default to PIC code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)