diff options
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/AbseilDll.cmake | 103 | ||||
-rw-r--r-- | CMake/AbseilHelpers.cmake | 19 | ||||
-rw-r--r-- | CMake/Googletest/CMakeLists.txt.in | 2 | ||||
-rw-r--r-- | CMake/README.md | 4 | ||||
-rw-r--r-- | CMake/install_test_project/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | CMake/install_test_project/test.sh | 9 |
6 files changed, 114 insertions, 25 deletions
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake index 47f3beeb..32cc28fb 100644 --- a/CMake/AbseilDll.cmake +++ b/CMake/AbseilDll.cmake @@ -28,6 +28,8 @@ set(ABSL_INTERNAL_DLL_FILES "base/internal/low_level_scheduling.h" "base/internal/nullability_impl.h" "base/internal/per_thread_tls.h" + "base/internal/poison.cc" + "base/internal/poison.h" "base/prefetch.h" "base/internal/pretty_function.h" "base/internal/raw_logging.cc" @@ -66,6 +68,7 @@ set(ABSL_INTERNAL_DLL_FILES "cleanup/internal/cleanup.h" "container/btree_map.h" "container/btree_set.h" + "container/hash_container_defaults.h" "container/fixed_array.h" "container/flat_hash_map.h" "container/flat_hash_set.h" @@ -121,8 +124,13 @@ set(ABSL_INTERNAL_DLL_FILES "debugging/symbolize.h" "debugging/internal/address_is_readable.cc" "debugging/internal/address_is_readable.h" + "debugging/internal/bounded_utf8_length_sequence.h" + "debugging/internal/decode_rust_punycode.cc" + "debugging/internal/decode_rust_punycode.h" "debugging/internal/demangle.cc" "debugging/internal/demangle.h" + "debugging/internal/demangle_rust.cc" + "debugging/internal/demangle_rust.h" "debugging/internal/elf_mem_image.cc" "debugging/internal/elf_mem_image.h" "debugging/internal/examine_stack.cc" @@ -131,6 +139,8 @@ set(ABSL_INTERNAL_DLL_FILES "debugging/internal/stack_consumption.h" "debugging/internal/stacktrace_config.h" "debugging/internal/symbolize.h" + "debugging/internal/utf8_for_code_point.cc" + "debugging/internal/utf8_for_code_point.h" "debugging/internal/vdso_support.cc" "debugging/internal/vdso_support.h" "functional/any_invocable.h" @@ -311,7 +321,6 @@ set(ABSL_INTERNAL_DLL_FILES "strings/internal/string_constant.h" "strings/internal/stringify_sink.h" "strings/internal/stringify_sink.cc" - "strings/internal/has_absl_stringify.h" "strings/has_absl_stringify.h" "strings/has_ostream_operator.h" "strings/match.cc" @@ -437,9 +446,47 @@ set(ABSL_INTERNAL_DLL_FILES "debugging/leak_check.cc" ) +if(NOT MSVC) + list(APPEND ABSL_INTERNAL_DLL_FILES + "flags/commandlineflag.cc" + "flags/commandlineflag.h" + "flags/config.h" + "flags/declare.h" + "flags/flag.h" + "flags/internal/commandlineflag.cc" + "flags/internal/commandlineflag.h" + "flags/internal/flag.cc" + "flags/internal/flag.h" + "flags/internal/parse.h" + "flags/internal/path_util.h" + "flags/internal/private_handle_accessor.cc" + "flags/internal/private_handle_accessor.h" + "flags/internal/program_name.cc" + "flags/internal/program_name.h" + "flags/internal/registry.h" + "flags/internal/sequence_lock.h" + "flags/internal/usage.cc" + "flags/internal/usage.h" + "flags/marshalling.cc" + "flags/marshalling.h" + "flags/parse.cc" + "flags/parse.h" + "flags/reflection.cc" + "flags/reflection.h" + "flags/usage.cc" + "flags/usage.h" + "flags/usage_config.cc" + "flags/usage_config.h" + "log/flags.cc" + "log/flags.h" + "log/internal/flags.h" + ) +endif() + set(ABSL_INTERNAL_DLL_TARGETS "absl_check" "absl_log" + "absl_vlog_is_on" "algorithm" "algorithm_container" "any" @@ -505,6 +552,7 @@ set(ABSL_INTERNAL_DLL_TARGETS "log_internal_check_op" "log_internal_conditions" "log_internal_config" + "log_internal_fnmatch" "log_internal_format" "log_internal_globals" "log_internal_log_impl" @@ -584,6 +632,7 @@ set(ABSL_INTERNAL_DLL_TARGETS "strerror" "strings" "strings_internal" + "string_view" "symbolize" "synchronization" "thread_pool" @@ -594,8 +643,30 @@ set(ABSL_INTERNAL_DLL_TARGETS "type_traits" "utility" "variant" + "vlog_config_internal" + "vlog_is_on" ) +if(NOT MSVC) + list(APPEND ABSL_INTERNAL_DLL_TARGETS + "flags" + "flags_commandlineflag" + "flags_commandlineflag_internal" + "flags_config" + "flags_internal" + "flags_marshalling" + "flags_parse" + "flags_path_util" + "flags_private_handle_accessor" + "flags_program_name" + "flags_reflection" + "flags_usage" + "flags_usage_internal" + "log_internal_flags" + "log_flags" + ) +endif() + set(ABSL_INTERNAL_TEST_DLL_FILES "hash/hash_testing.h" "log/scoped_mock_log.cc" @@ -608,6 +679,9 @@ set(ABSL_INTERNAL_TEST_DLL_FILES "random/internal/mock_overload_set.h" "random/mocking_bit_gen.h" "random/mock_distributions.h" + "status/status_matchers.h" + "status/internal/status_matchers.cc" + "status/internal/status_matchers.h" "strings/cordz_test_helpers.h" "strings/cord_test_helpers.h" ) @@ -620,6 +694,7 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS "random_internal_distribution_test_util" "random_internal_mock_overload_set" "scoped_mock_log" + "status_matchers" ) include(CheckCXXSourceCompiles) @@ -668,12 +743,7 @@ function(absl_internal_dll_contains) STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET}) - list(FIND - ABSL_INTERNAL_DLL_TARGETS - "${_target}" - _index) - - if (${_index} GREATER -1) + if (_target IN_LIST ABSL_INTERNAL_DLL_TARGETS) set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE) else() set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE) @@ -690,12 +760,7 @@ function(absl_internal_test_dll_contains) STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_TEST_DLL_TARGET}) - list(FIND - ABSL_INTERNAL_TEST_DLL_TARGETS - "${_target}" - _index) - - if (${_index} GREATER -1) + if (_target IN_LIST ABSL_INTERNAL_TEST_DLL_TARGETS) set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 1 PARENT_SCOPE) else() set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 0 PARENT_SCOPE) @@ -747,7 +812,12 @@ function(absl_make_dll) else() set(_dll "abseil_dll") set(_dll_files ${ABSL_INTERNAL_DLL_FILES}) - set(_dll_libs "") + set(_dll_libs + Threads::Threads + # TODO(#1495): Use $<LINK_LIBRARY:FRAMEWORK,CoreFoundation> once our + # minimum CMake version >= 3.24 + $<$<PLATFORM_ID:Darwin>:-Wl,-framework,CoreFoundation> + ) set(_dll_compile_definitions "") set(_dll_includes "") set(_dll_consume "ABSL_CONSUME_DLL") @@ -765,7 +835,10 @@ function(absl_make_dll) ${_dll_libs} ${ABSL_DEFAULT_LINKOPTS} ) - set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX") + set_target_properties(${_dll} PROPERTIES + LINKER_LANGUAGE "CXX" + SOVERSION ${ABSL_SOVERSION} + ) target_include_directories( ${_dll} PUBLIC diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index c53b3584..b177e590 100644 --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake @@ -186,8 +186,16 @@ function(absl_cc_library) endif() endif() endforeach() + set(skip_next_cflag OFF) foreach(cflag ${ABSL_CC_LIB_COPTS}) - if(${cflag} MATCHES "^(-Wno|/wd)") + if(skip_next_cflag) + set(skip_next_cflag OFF) + elseif(${cflag} MATCHES "^-Xarch_") + # An -Xarch_ flag implies that its successor only applies to the + # specified platform. Filter both of them out before the successor + # reaches the "^-m" filter. + set(skip_next_cflag ON) + elseif(${cflag} MATCHES "^(-Wno|/wd)") # These flags are needed to suppress warnings that might fire in our headers. set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") elseif(${cflag} MATCHES "^(-W|/w[1234eo])") @@ -250,6 +258,13 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") elseif(_build_type STREQUAL "static" OR _build_type STREQUAL "shared") add_library(${_NAME} "") target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS}) + if(APPLE) + set_target_properties(${_NAME} PROPERTIES + INSTALL_RPATH "@loader_path") + elseif(UNIX) + set_target_properties(${_NAME} PROPERTIES + INSTALL_RPATH "$ORIGIN") + endif() target_link_libraries(${_NAME} PUBLIC ${ABSL_CC_LIB_DEPS} PRIVATE @@ -298,7 +313,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") if(ABSL_ENABLE_INSTALL) set_target_properties(${_NAME} PROPERTIES OUTPUT_NAME "absl_${_NAME}" - SOVERSION "2401.0.0" + SOVERSION "${ABSL_SOVERSION}" ) endif() else() diff --git a/CMake/Googletest/CMakeLists.txt.in b/CMake/Googletest/CMakeLists.txt.in index 75691b11..3db48341 100644 --- a/CMake/Googletest/CMakeLists.txt.in +++ b/CMake/Googletest/CMakeLists.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(googletest-external NONE) diff --git a/CMake/README.md b/CMake/README.md index c7ddee64..808edfe8 100644 --- a/CMake/README.md +++ b/CMake/README.md @@ -39,7 +39,7 @@ section of your executable or of your library.<br> Here is a short CMakeLists.txt example of an application project using Abseil. ```cmake -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(my_app_project) # Pick the C++ standard to compile with. @@ -62,7 +62,7 @@ will control Abseil library targets) is set to at least that minimum. For example: ```cmake -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(my_lib_project) # Leave C++ standard up to the root application, so set it only if this is the diff --git a/CMake/install_test_project/CMakeLists.txt b/CMake/install_test_project/CMakeLists.txt index 30c23b2c..3229887c 100644 --- a/CMake/install_test_project/CMakeLists.txt +++ b/CMake/install_test_project/CMakeLists.txt @@ -15,7 +15,7 @@ # A simple CMakeLists.txt for testing cmake installation -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(absl_cmake_testing CXX) add_executable(simple simple.cc) diff --git a/CMake/install_test_project/test.sh b/CMake/install_test_project/test.sh index cc028bac..962bc8d2 100755 --- a/CMake/install_test_project/test.sh +++ b/CMake/install_test_project/test.sh @@ -22,7 +22,8 @@ set -euox pipefail absl_dir=/abseil-cpp absl_build_dir=/buildfs googletest_builddir=/googletest_builddir -project_dir="${absl_dir}"/CMake/install_test_project +googletest_archive="googletest-${ABSL_GOOGLETEST_VERSION}.tar.gz" +project_dir="${absl_dir}/CMake/install_test_project" project_build_dir=/buildfs/project-build build_shared_libs="OFF" @@ -33,9 +34,9 @@ fi # Build and install GoogleTest mkdir "${googletest_builddir}" pushd "${googletest_builddir}" -curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${ABSL_GOOGLETEST_COMMIT}".zip -unzip "${ABSL_GOOGLETEST_COMMIT}".zip -pushd "googletest-${ABSL_GOOGLETEST_COMMIT}" +curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${googletest_archive}" +tar -xz -f "${googletest_archive}" +pushd "googletest-${ABSL_GOOGLETEST_VERSION}" mkdir build pushd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" .. |