diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt index 4cfc22858c0..c1e29b05cef 100644 --- a/absl/base/CMakeLists.txt +++ b/absl/base/CMakeLists.txt @@ -16,6 +16,12 @@ find_library(LIBRT rt) +string(SUBSTRING ${CMAKE_SYSTEM} 0 3 system_os) +if(system_os STREQUAL "AIX") + set(SAFETY_TESTING_TEST "-Wl,-bkeepfile:CMakeFiles/absl_absl_exception_safety_testing_test.dir/exception_safety_testing_test.cc.o") + set(DELEGATE_TEST "-Wl,-bkeepfile:CMakeFiles/absl_throw_delegate_test.dir/throw_delegate_test.cc.o") +endif() + # Internal-only target, do not depend on directly. absl_cc_library( NAME @@ -322,6 +328,8 @@ absl_cc_test( "exception_safety_testing_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${SAFETY_TESTING_TEST} DEPS absl::exception_safety_testing absl::memory @@ -391,6 +399,8 @@ absl_cc_test( "throw_delegate_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${DELEGATE_TEST} DEPS absl::base absl::config diff --git a/absl/container/CMakeLists.txt b/absl/container/CMakeLists.txt index 3f80d29bd5c..2e1b1ce9b8e 100644 --- a/absl/container/CMakeLists.txt +++ b/absl/container/CMakeLists.txt @@ -14,6 +14,15 @@ # limitations under the License. # +string(SUBSTRING ${CMAKE_SYSTEM} 0 3 system_os) +if(system_os STREQUAL "AIX") + set(BTREE_TEST "-Wl,-bkeepfile:CMakeFiles/absl_btree_test.dir/btree_test.cc.o") + set(FIXED_ARRAY_TEST "-Wl,-bkeepfile:CMakeFiles/absl_fixed_array_test.dir/fixed_array_test.cc.o") + set(FIXED_ARRAY_EXCEPTION_TEST "-Wl,-bkeepfile:CMakeFiles/absl_fixed_array_exception_safety_test.dir/fixed_array_exception_safety_test.cc.o") + set(INLINED_VECTOR_TEST "-Wl,-bkeepfile:CMakeFiles/absl_inlined_vector_test.dir/inlined_vector_test.cc.o") + set(INLINED_VECTOR_EXCEPTION_TEST "-Wl,-bkeepfile:CMakeFiles/absl_inlined_vector_exception_safety_test.dir/inlined_vector_exception_safety_test.cc.o") +endif() + absl_cc_library( NAME btree @@ -71,6 +80,7 @@ absl_cc_test( ${ABSL_TEST_COPTS} LINKOPTS ${ABSL_DEFAULT_LINKOPTS} + ${BTREE_TEST} DEPS absl::algorithm_container absl::btree @@ -143,6 +153,8 @@ absl_cc_test( "fixed_array_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${FIXED_ARRAY_TEST} DEPS absl::fixed_array absl::config @@ -160,6 +172,8 @@ absl_cc_test( "fixed_array_exception_safety_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${FIXED_ARRAY_EXCEPTION_TEST} DEPS absl::fixed_array absl::config @@ -223,6 +237,8 @@ absl_cc_test( "inlined_vector_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${INLINED_VECTOR_TEST} DEPS absl::check absl::config @@ -244,6 +260,8 @@ absl_cc_test( "inlined_vector_exception_safety_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${INLINED_VECTOR_EXCEPTION_TEST} DEPS absl::inlined_vector absl::config diff --git a/absl/status/CMakeLists.txt b/absl/status/CMakeLists.txt index 00415ab94da..badb8f76245 100644 --- a/absl/status/CMakeLists.txt +++ b/absl/status/CMakeLists.txt @@ -13,6 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +string(SUBSTRING ${CMAKE_SYSTEM} 0 3 system_os) +if(system_os STREQUAL "AIX") + set(STATUSOR_TEST "-Wl,-bkeepfile:CMakeFiles/absl_statusor_test.dir/statusor_test.cc.o") +endif() + absl_cc_library( NAME status @@ -96,6 +102,8 @@ absl_cc_test( "statusor_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${STATUSOR_TEST} DEPS absl::status absl::statusor diff --git a/absl/strings/CMakeLists.txt b/absl/strings/CMakeLists.txt index 9258e553ac6..e0412c39a30 100644 --- a/absl/strings/CMakeLists.txt +++ b/absl/strings/CMakeLists.txt @@ -14,6 +14,12 @@ # limitations under the License. # +string(SUBSTRING ${CMAKE_SYSTEM} 0 3 system_os) +if(system_os STREQUAL "AIX") + set(STRING_VIEW_TEST "-Wl,-bkeepfile:CMakeFiles/absl_string_view_test.dir/string_view_test.cc.o") + set(STR_SPLIT_TEST "-Wl,-bkeepfile:CMakeFiles/absl_str_split_test.dir/str_split_test.cc.o") +endif() + absl_cc_library( NAME string_view @@ -269,6 +275,8 @@ absl_cc_test( "string_view_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${STRING_VIEW_TEST} DEPS absl::strings absl::config @@ -309,6 +317,8 @@ absl_cc_test( "str_split_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${STR_SPLIT_TEST} DEPS absl::strings absl::core_headers diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt index 92b4ae493ce..8e2144eab70 100644 --- a/absl/types/CMakeLists.txt +++ b/absl/types/CMakeLists.txt @@ -13,6 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +string(SUBSTRING ${CMAKE_SYSTEM} 0 3 system_os) +if(system_os STREQUAL "AIX") + set(ANY_TEST "-Wl,-bkeepfile:CMakeFiles/absl_any_test.dir/any_test.cc.o") + set(ANY_TEST_NOEXCEPTION "-Wl,-bkeepfile:CMakeFiles/absl_any_test_noexceptions.dir/any_test.cc.o") + set(ANY_EXCEPTION_SAFETY_TEST "-Wl,-bkeepfile:CMakeFiles/absl_any_exception_safety_test.dir/any_exception_safety_test.cc.o") + set(SPAN_TEST "-Wl,-bkeepfile:CMakeFiles/absl_span_test.dir/span_test.cc.o") + set(SPAN_TEST_NOEXCEPTION "-Wl,-bkeepfile:CMakeFiles/absl_span_test_noexceptions.dir/span_test.cc.o") + set(OPTIONAL_TEST "-Wl,-bkeepfile:CMakeFiles/absl_optional_test.dir/optional_test.cc.o") + set(OPTIONAL_SAFETY_TEST "-Wl,-bkeepfile:CMakeFiles/absl_optional_exception_safety_test.dir/optional_exception_safety_test.cc.o") + set(VARIANT_TEST "-Wl,-bkeepfile:CMakeFiles/absl_variant_test.dir/variant_test.cc.o") + set(VARIANT_SAFETY_TEST "-Wl,-bkeepfile:CMakeFiles/absl_variant_exception_safety_test.dir/variant_exception_safety_test.cc.o") +endif() + absl_cc_library( NAME any @@ -64,6 +78,8 @@ absl_cc_test( "any_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${ANY_TEST} DEPS absl::any absl::config @@ -80,6 +96,8 @@ absl_cc_test( "any_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${ANY_TEST_NOEXCEPTION} DEPS absl::any absl::config @@ -96,6 +114,8 @@ absl_cc_test( "any_exception_safety_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${ANY_EXCEPTION_SAFETY_TEST} DEPS absl::any absl::config @@ -128,6 +148,8 @@ absl_cc_test( "span_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${SPAN_TEST} DEPS absl::span absl::base @@ -148,6 +170,8 @@ absl_cc_test( "span_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${SPAN_TEST_NOEXCEPTION} DEPS absl::span absl::base @@ -219,6 +243,8 @@ absl_cc_test( "optional_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${OPTIONAL_TEST} DEPS absl::optional absl::config @@ -235,6 +261,8 @@ absl_cc_test( "optional_exception_safety_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${OPTIONAL_SAFETY_TEST} DEPS absl::optional absl::config @@ -268,6 +296,8 @@ absl_cc_test( "variant_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${VARIANT_TEST} DEPS absl::variant absl::config @@ -312,6 +342,8 @@ absl_cc_test( "variant_exception_safety_test.cc" COPTS ${ABSL_TEST_COPTS} + LINKOPTS + ${VARIANT_SAFETY_TEST} DEPS absl::variant absl::config