Skip to content

Commit

Permalink
Link libstd++ and gcc lib statically (XRPLF#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
legleux authored Aug 24, 2023
1 parent 435d56e commit d7f3673
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(clio)
# ========================================================================== #
# Options #
# ========================================================================== #
option (verbose "Verbose build" FALSE)
option (verbose "Verbose build" FALSE)
option (tests "Build tests" FALSE)
option (docs "Generate doxygen docs" FALSE)
option (coverage "Build test coverage report" FALSE)
Expand Down Expand Up @@ -135,7 +135,11 @@ target_sources (clio PRIVATE

# Clio server
add_executable (clio_server src/main/Main.cpp)
target_link_libraries (clio_server PUBLIC clio)
target_link_libraries (clio_server PRIVATE clio)
target_link_options(clio_server
PRIVATE
$<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${san}>>>:-static-libstdc++ -static-libgcc>
)

# Unittesting
if (tests)
Expand Down Expand Up @@ -219,7 +223,7 @@ if (tests)
# See https://github.com/google/googletest/issues/3475
gtest_discover_tests (clio_tests DISCOVERY_TIMEOUT 10)

# Fix for dwarf5 bug on ci
# Fix for dwarf5 bug on ci
target_compile_options (clio PUBLIC -gdwarf-4)

target_compile_definitions (${TEST_TARGET} PUBLIC UNITTEST_BUILD)
Expand Down

0 comments on commit d7f3673

Please sign in to comment.