Link libstd++ and gcc lib statically (#830)

This commit is contained in:
Michael Legleux
2023-08-24 04:41:08 -07:00
committed by GitHub
parent 435d56e7c5
commit d7f36733bc

View File

@@ -4,7 +4,7 @@ project(clio)
# ========================================================================== # # ========================================================================== #
# Options # # Options #
# ========================================================================== # # ========================================================================== #
option (verbose "Verbose build" FALSE) option (verbose "Verbose build" FALSE)
option (tests "Build tests" FALSE) option (tests "Build tests" FALSE)
option (docs "Generate doxygen docs" FALSE) option (docs "Generate doxygen docs" FALSE)
option (coverage "Build test coverage report" FALSE) option (coverage "Build test coverage report" FALSE)
@@ -135,7 +135,11 @@ target_sources (clio PRIVATE
# Clio server # Clio server
add_executable (clio_server src/main/Main.cpp) 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 # Unittesting
if (tests) if (tests)
@@ -219,7 +223,7 @@ if (tests)
# See https://github.com/google/googletest/issues/3475 # See https://github.com/google/googletest/issues/3475
gtest_discover_tests (clio_tests DISCOVERY_TIMEOUT 10) 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_options (clio PUBLIC -gdwarf-4)
target_compile_definitions (${TEST_TARGET} PUBLIC UNITTEST_BUILD) target_compile_definitions (${TEST_TARGET} PUBLIC UNITTEST_BUILD)