Better handle PIC / static linking
This commit is contained in:
parent
b236da4a0b
commit
bbcd8db054
@ -202,8 +202,6 @@ endif()
|
||||
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(
|
||||
sources
|
||||
src/cpptrace.cpp
|
||||
@ -228,6 +226,7 @@ if(CPPTRACE_STATIC)
|
||||
add_library(cpptrace STATIC ${sources} include/cpptrace/cpptrace.hpp)
|
||||
else()
|
||||
add_library(cpptrace SHARED ${sources} include/cpptrace/cpptrace.hpp)
|
||||
set_property(TARGET cpptrace PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
target_include_directories(
|
||||
|
||||
6
bundled/libdwarf/CMakeLists.txt
vendored
6
bundled/libdwarf/CMakeLists.txt
vendored
@ -421,12 +421,10 @@ set(
|
||||
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
### libassert uses relocs, -fpic has to be used to allow shared libs to link libassert as a static library.
|
||||
##set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
add_library(dwarf STATIC ${libdwarf_sources} ${libdwarf_headers})
|
||||
add_library(dwarf OBJECT ${libdwarf_sources} ${libdwarf_headers})
|
||||
set_property(TARGET dwarf PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
target_compile_definitions(dwarf PUBLIC LIBDWARF_BUILD)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user