2923513914
-- a7e789be4687681b98060fddbf8bd1c64a8f5908 by Abseil Team <absl-team@google.com>: Support C++20 erase_if API in btree. See the reference here: https://en.cppreference.com/w/cpp/container/set/erase_if. PiperOrigin-RevId: 286235196 -- 952dd2fdd8435dd293e2186c97e14ef3f29a1aa6 by Derek Mauro <dmauro@google.com>: Avoids accessing an out-of-bounds value during flag parsing PiperOrigin-RevId: 286206167 -- ba24591ade579fc4446a09bb3f23bf3602908c04 by Abseil Team <absl-team@google.com>: Change null term* (and nul term*) to NUL-term* in comments. PiperOrigin-RevId: 286066376 -- d770baecf36f3d7a8214ca2033d90696ba353d00 by Andy Soffer <asoffer@google.com>: cmake: Fix x86_64 check on Windows for random copts Import of https://github.com/abseil/abseil-cpp/pull/518 PiperOrigin-RevId: 286056395 -- 9ed007e284ecf6ec79547437dbed9ce3023204b9 by Greg Falcon <gfalcon@google.com>: Manual re-import of CCTZ from GitHub. filegroup() moved as a side effect of an internal change. PiperOrigin-RevId: 286015866 -- 25441cc5cb7ee906177f8dac0dcd524df0e6e305 by Derek Mauro <dmauro@google.com>: Fix implicit cycle in debugging build rules due to .inc files PiperOrigin-RevId: 285873346 GitOrigin-RevId: a7e789be4687681b98060fddbf8bd1c64a8f5908 Change-Id: Idef8cce4e723fccae6bdd749e94e11e655908214
67 lines
2.6 KiB
CMake
67 lines
2.6 KiB
CMake
# See absl/copts/copts.py and absl/copts/generate_copts.py
|
|
include(GENERATED_AbseilCopts)
|
|
|
|
set(ABSL_LSAN_LINKOPTS "")
|
|
set(ABSL_HAVE_LSAN OFF)
|
|
set(ABSL_DEFAULT_LINKOPTS "")
|
|
|
|
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
|
if (MSVC)
|
|
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_MSVC_X64_FLAGS}")
|
|
else()
|
|
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_X64_FLAGS}")
|
|
endif()
|
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm")
|
|
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
|
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_ARM64_FLAGS}")
|
|
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
|
set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_ARM32_FLAGS}")
|
|
else()
|
|
message(WARNING "Value of CMAKE_SIZEOF_VOID_P (${CMAKE_SIZEOF_VOID_P}) is not supported.")
|
|
endif()
|
|
else()
|
|
message(WARNING "Value of CMAKE_SYSTEM_PROCESSOR (${CMAKE_SYSTEM_PROCESSOR}) is unknown and cannot be used to set ABSL_RANDOM_RANDEN_COPTS")
|
|
set(ABSL_RANDOM_RANDEN_COPTS "")
|
|
endif()
|
|
|
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_GCC_FLAGS}")
|
|
set(ABSL_TEST_COPTS "${ABSL_GCC_FLAGS};${ABSL_GCC_TEST_FLAGS}")
|
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|
# MATCHES so we get both Clang and AppleClang
|
|
if(MSVC)
|
|
# clang-cl is half MSVC, half LLVM
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_CLANG_CL_FLAGS}")
|
|
set(ABSL_TEST_COPTS "${ABSL_CLANG_CL_FLAGS};${ABSL_CLANG_CL_TEST_FLAGS}")
|
|
set(ABSL_DEFAULT_LINKOPTS "${ABSL_MSVC_LINKOPTS}")
|
|
else()
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_LLVM_FLAGS}")
|
|
set(ABSL_TEST_COPTS "${ABSL_LLVM_FLAGS};${ABSL_LLVM_TEST_FLAGS}")
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
# AppleClang doesn't have lsan
|
|
# https://developer.apple.com/documentation/code_diagnostics
|
|
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
|
|
set(ABSL_LSAN_LINKOPTS "-fsanitize=leak")
|
|
set(ABSL_HAVE_LSAN ON)
|
|
endif()
|
|
endif()
|
|
endif()
|
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_MSVC_FLAGS}")
|
|
set(ABSL_TEST_COPTS "${ABSL_MSVC_FLAGS};${ABSL_MSVC_TEST_FLAGS}")
|
|
set(ABSL_DEFAULT_LINKOPTS "${ABSL_MSVC_LINKOPTS}")
|
|
else()
|
|
message(WARNING "Unknown compiler: ${CMAKE_CXX_COMPILER}. Building with no default flags")
|
|
set(ABSL_DEFAULT_COPTS "")
|
|
set(ABSL_TEST_COPTS "")
|
|
endif()
|
|
|
|
if("${CMAKE_CXX_STANDARD}" EQUAL 98)
|
|
message(FATAL_ERROR "Abseil requires at least C++11")
|
|
elseif(NOT "${CMAKE_CXX_STANDARD}")
|
|
message(STATUS "No CMAKE_CXX_STANDARD set, assuming 11")
|
|
set(ABSL_CXX_STANDARD 11)
|
|
else()
|
|
set(ABSL_CXX_STANDARD "${CMAKE_CXX_STANDARD}")
|
|
endif()
|