When we were doing STATICC we were linking libdw dynamically, still requiring many dependencies. THis switches to libbfd, which should massively reduce the number of required libraries.
This commit is contained in:
parent
12f643a80e
commit
47ee3a0295
|
@ -5,6 +5,7 @@ project(Arbutils)
|
||||||
add_compile_options(-Wall -Wextra -Werror)
|
add_compile_options(-Wall -Wextra -Werror)
|
||||||
# We like new stuff, so set the c++ standard to c++20.
|
# We like new stuff, so set the c++ standard to c++20.
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
||||||
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
option(SHARED "Whether we should build a shared library, instead of a static one." OFF)
|
||||||
|
@ -49,7 +50,7 @@ endif()
|
||||||
|
|
||||||
set(LINKS)
|
set(LINKS)
|
||||||
if (NOT WINDOWS AND PRETTYTRACES)
|
if (NOT WINDOWS AND PRETTYTRACES)
|
||||||
set(LINKS ${LINKS} -ldw)
|
set(LINKS ${LINKS} -lbfd -ldl)
|
||||||
ADD_DEFINITIONS(-DPRETTYTRACES=1)
|
ADD_DEFINITIONS(-DPRETTYTRACES=1)
|
||||||
endif()
|
endif()
|
||||||
if (SIGNAL_HANDLING)
|
if (SIGNAL_HANDLING)
|
||||||
|
@ -58,7 +59,9 @@ endif()
|
||||||
|
|
||||||
# If we want to link the C and C++ library statically, link those as well.
|
# If we want to link the C and C++ library statically, link those as well.
|
||||||
if (STATICC)
|
if (STATICC)
|
||||||
set(LINKS ${LINKS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread)
|
message("Linking dependencies statically.")
|
||||||
|
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
|
||||||
|
set(LINKS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic ${LINKS})
|
||||||
endif(STATICC)
|
endif(STATICC)
|
||||||
target_link_libraries(Arbutils ${LINKS})
|
target_link_libraries(Arbutils ${LINKS})
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#if !WINDOWS
|
#if !WINDOWS
|
||||||
#if PRETTYTRACES
|
#if PRETTYTRACES
|
||||||
#define BACKWARD_HAS_DW 1
|
#define BACKWARD_HAS_BFD 1
|
||||||
#endif
|
#endif
|
||||||
#include "../extern/backward.hpp"
|
#include "../extern/backward.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue