Export of internal Abseil changes.
--
22fa219d17b2281c0695642830c4300711bd65ea by CJ Johnson <johnsoncj@google.com>:
Rearrange the private method declarations in InlinedVector
PiperOrigin-RevId: 224202447
--
eed3c9f488f23b521bee41d3683eb6cc22517ded by Derek Mauro <dmauro@google.com>:
Fix leak_check target (it was always a no-op when LSAN isn't available).
Fixes https://github.com/abseil/abseil-cpp/issues/232
PiperOrigin-RevId: 224201634
--
fc08039e175204b14a9561f618fcfc0234586801 by Greg Falcon <gfalcon@google.com>:
Add parens around more invocations of min() and max() missed in my prior CL.
PiperOrigin-RevId: 224162430
--
0ec5476a8293c7796cd84928a1a558b14f14f222 by Abseil Team <absl-team@google.com>:
Update absl/numeric/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224139165
--
2b46aa6fabb20c589661f8bbc84030ecf39ce394 by Abseil Team <absl-team@google.com>:
Update absl/meta/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224117258
--
6c951c798f8c6903bd8793a8a4b5f69244be8aa9 by Abseil Team <absl-team@google.com>:
Fix 2 Unused C++ BUILD Dependencies
PiperOrigin-RevId: 224070093
--
0ee7bd191708708f91fc5209c197fd93f6e4a8b3 by Greg Falcon <gfalcon@google.com>:
Inside Abseil headers, wrap most invocations of methods and functions named `min` and `max` in parentheses, for better interoperability with Windows toolchains.
CCTZ fixes will appear in a follow-up CL.
PiperOrigin-RevId: 224051960
--
f562f56577b84a8bc07e5873775c01d068531bca by Jon Cohen <cohenjon@google.com>:
Generate Abseil compile options. The single source of truth is now absl/copts/copts.py
The way this works goes something like this:
copts.py acts as the configuration file. We use python because unlike JSON it allows comments. It has two maps in it: one from names to external flags, and one from names to internal flags.
generate_copts.py imports the maps and loops through them to write GENERATED_copts.bzl and GENERATED_AbseilCopts.cmake
AbseilConfigureCopts.cmake and configure_copts.bzl import their respective copts args and set the platform-appropriate copts into ABSL_DEFAULT_COPTS, ABSL_TEST_COPTS, ABSL_EXCEPTIONS_FLAG, and ABSL_EXCEPTIONS_LINKOPTS
For Bazel, each BUILD file load()s configure_copts.bzl
For CMake, AbseilHelpers.cmake include()s AbseilConfigureCopts.cmake to get the final copts and both inserts them as needed into legacy target rules and also makes them available to the rest of our CMakeLists.txt file. We may instead want to include() AbseilConfigureCopts.cmake directly into each CMakeLists.txt file for consistency, but I'm not sure what the deal is with cmake and include guards, or if they are even needed. That's also not as idiomatic -- CMake tends to use directory scope where globals set at a higher level CMakeLists.txt file are used in the subdirectory CMakeLists.txt files.
PiperOrigin-RevId: 224039419
--
f7402f6bb65037e668a7355f0a003f5c05a3b6a7 by Abseil Team <absl-team@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 224036622
GitOrigin-RevId: 22fa219d17b2281c0695642830c4300711bd65ea
Change-Id: I6b505360539ff2aef8aa30c51a5f7d55db1c75cf
2018-12-05 21:37:41 +01:00
|
|
|
# See absl/copts/copts.py and absl/copts/generate_copts.py
|
|
|
|
include(GENERATED_AbseilCopts)
|
|
|
|
|
2019-02-19 23:29:09 +01:00
|
|
|
set(ABSL_LSAN_LINKOPTS "")
|
|
|
|
set(ABSL_HAVE_LSAN OFF)
|
2019-03-27 16:05:41 +01:00
|
|
|
set(ABSL_DEFAULT_LINKOPTS "")
|
2019-02-19 23:29:09 +01:00
|
|
|
|
2020-01-28 20:50:11 +01:00
|
|
|
if (BUILD_SHARED_LIBS AND MSVC)
|
|
|
|
set(ABSL_BUILD_DLL TRUE)
|
|
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
|
|
else()
|
|
|
|
set(ABSL_BUILD_DLL FALSE)
|
|
|
|
endif()
|
|
|
|
|
2019-12-18 20:46:26 +01:00
|
|
|
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
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()
|
2020-01-24 21:27:04 +01:00
|
|
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm.*|aarch64")
|
Export of internal Abseil changes
--
e54b9c7bbb0c58475676c268e2e19c69f4bce48a by Jorg Brown <jorg@google.com>:
Tweak ABSL_PREDICT_TRUE slightly, for better code on some platforms and/or
optimization levels. "false || (x)" is more verbose than "!!(x)", but
ultimately more efficient.
For example, given this code:
void InitIfNecessary() {
if (ABSL_PREDICT_TRUE(NeedsInit())) {
SlowInitIfNecessary();
}
}
Clang with default optimization level will produce:
Before this CL After this CL
InitIfNecessary: InitIfNecessary:
push rbp push rbp
mov rbp, rsp mov rbp, rsp
call NeedsInit call NeedsInit
xor al, -1
xor al, -1
test al, 1 test al, 1
jne .LBB2_1 jne .LBB3_1
jmp .LBB2_2 jmp .LBB3_2
.LBB2_1: .LBB3_1:
call SlowInitIfNecessary call SlowInitIfNecessary
.LBB2_2: .LBB3_2:
pop rbp pop rbp
ret ret
PiperOrigin-RevId: 276401386
--
0a3c4dfd8342bf2b1b11a87f1c662c883f73cab7 by Abseil Team <absl-team@google.com>:
Fix comment nit: sem_open => sem_init.
The code calls sem_init, not sem_open, to initialize an unnamed semaphore.
(sem_open creates or opens a named semaphore.)
PiperOrigin-RevId: 276344072
--
b36a664e9459057509a90e83d3482e1d3a4c44c7 by Abseil Team <absl-team@google.com>:
Fix typo in flat_hash_map.h: exchaged -> exchanged
PiperOrigin-RevId: 276295792
--
7bbd8d18276eb110c8335743e35fceb662ddf3d6 by Samuel Benzaquen <sbenza@google.com>:
Add assertions to verify use of iterators.
PiperOrigin-RevId: 276283300
--
677398a8ffcb1f59182cffe57a4fe7ff147a0404 by Laramie Leavitt <lar@google.com>:
Migrate distribution_impl.h/cc to generate_real.h/cc.
Combine the methods RandU64To<Float,Double> into a single method:
GenerateRealFromBits().
Remove rejection sampling from absl::uniform_real_distribution.
PiperOrigin-RevId: 276158675
--
c60c9d11d24b0c546329d998e78e15a84b3153f5 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276126962
--
4c840cab6a8d86efa29b397cafaf7520eece68cc by Andy Soffer <asoffer@google.com>:
Update CMakeLists.txt to address https://github.com/abseil/abseil-cpp/issues/365.
This does not cover every platform, but it does at least address the
first-order issue of assuming gcc implies x86.
PiperOrigin-RevId: 276116253
--
98da366e6b5d51afe5d7ac6722126aca23d85ee6 by Abseil Team <absl-team@google.com>:
Internal change
PiperOrigin-RevId: 276097452
GitOrigin-RevId: e54b9c7bbb0c58475676c268e2e19c69f4bce48a
Change-Id: I02d84454bb71ab21ad3d39650acf6cc6e36f58d7
2019-10-24 04:35:39 +02:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2019-03-28 19:12:19 +01:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
2019-03-22 20:23:01 +01:00
|
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_GCC_FLAGS}")
|
|
|
|
set(ABSL_TEST_COPTS "${ABSL_GCC_FLAGS};${ABSL_GCC_TEST_FLAGS}")
|
Export of internal Abseil changes.
--
22fa219d17b2281c0695642830c4300711bd65ea by CJ Johnson <johnsoncj@google.com>:
Rearrange the private method declarations in InlinedVector
PiperOrigin-RevId: 224202447
--
eed3c9f488f23b521bee41d3683eb6cc22517ded by Derek Mauro <dmauro@google.com>:
Fix leak_check target (it was always a no-op when LSAN isn't available).
Fixes https://github.com/abseil/abseil-cpp/issues/232
PiperOrigin-RevId: 224201634
--
fc08039e175204b14a9561f618fcfc0234586801 by Greg Falcon <gfalcon@google.com>:
Add parens around more invocations of min() and max() missed in my prior CL.
PiperOrigin-RevId: 224162430
--
0ec5476a8293c7796cd84928a1a558b14f14f222 by Abseil Team <absl-team@google.com>:
Update absl/numeric/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224139165
--
2b46aa6fabb20c589661f8bbc84030ecf39ce394 by Abseil Team <absl-team@google.com>:
Update absl/meta/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224117258
--
6c951c798f8c6903bd8793a8a4b5f69244be8aa9 by Abseil Team <absl-team@google.com>:
Fix 2 Unused C++ BUILD Dependencies
PiperOrigin-RevId: 224070093
--
0ee7bd191708708f91fc5209c197fd93f6e4a8b3 by Greg Falcon <gfalcon@google.com>:
Inside Abseil headers, wrap most invocations of methods and functions named `min` and `max` in parentheses, for better interoperability with Windows toolchains.
CCTZ fixes will appear in a follow-up CL.
PiperOrigin-RevId: 224051960
--
f562f56577b84a8bc07e5873775c01d068531bca by Jon Cohen <cohenjon@google.com>:
Generate Abseil compile options. The single source of truth is now absl/copts/copts.py
The way this works goes something like this:
copts.py acts as the configuration file. We use python because unlike JSON it allows comments. It has two maps in it: one from names to external flags, and one from names to internal flags.
generate_copts.py imports the maps and loops through them to write GENERATED_copts.bzl and GENERATED_AbseilCopts.cmake
AbseilConfigureCopts.cmake and configure_copts.bzl import their respective copts args and set the platform-appropriate copts into ABSL_DEFAULT_COPTS, ABSL_TEST_COPTS, ABSL_EXCEPTIONS_FLAG, and ABSL_EXCEPTIONS_LINKOPTS
For Bazel, each BUILD file load()s configure_copts.bzl
For CMake, AbseilHelpers.cmake include()s AbseilConfigureCopts.cmake to get the final copts and both inserts them as needed into legacy target rules and also makes them available to the rest of our CMakeLists.txt file. We may instead want to include() AbseilConfigureCopts.cmake directly into each CMakeLists.txt file for consistency, but I'm not sure what the deal is with cmake and include guards, or if they are even needed. That's also not as idiomatic -- CMake tends to use directory scope where globals set at a higher level CMakeLists.txt file are used in the subdirectory CMakeLists.txt files.
PiperOrigin-RevId: 224039419
--
f7402f6bb65037e668a7355f0a003f5c05a3b6a7 by Abseil Team <absl-team@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 224036622
GitOrigin-RevId: 22fa219d17b2281c0695642830c4300711bd65ea
Change-Id: I6b505360539ff2aef8aa30c51a5f7d55db1c75cf
2018-12-05 21:37:41 +01:00
|
|
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|
|
|
# MATCHES so we get both Clang and AppleClang
|
2019-03-28 19:12:19 +01:00
|
|
|
if(MSVC)
|
2019-03-22 20:23:01 +01:00
|
|
|
# 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}")
|
2019-04-04 17:13:57 +02:00
|
|
|
set(ABSL_DEFAULT_LINKOPTS "${ABSL_MSVC_LINKOPTS}")
|
2019-03-22 20:23:01 +01:00
|
|
|
else()
|
|
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_LLVM_FLAGS}")
|
|
|
|
set(ABSL_TEST_COPTS "${ABSL_LLVM_FLAGS};${ABSL_LLVM_TEST_FLAGS}")
|
2019-03-28 19:12:19 +01:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2019-03-22 20:23:01 +01:00
|
|
|
# AppleClang doesn't have lsan
|
|
|
|
# https://developer.apple.com/documentation/code_diagnostics
|
2019-06-10 04:33:52 +02:00
|
|
|
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
|
2019-03-22 20:23:01 +01:00
|
|
|
set(ABSL_LSAN_LINKOPTS "-fsanitize=leak")
|
|
|
|
set(ABSL_HAVE_LSAN ON)
|
|
|
|
endif()
|
2019-02-19 23:29:09 +01:00
|
|
|
endif()
|
|
|
|
endif()
|
Export of internal Abseil changes.
--
22fa219d17b2281c0695642830c4300711bd65ea by CJ Johnson <johnsoncj@google.com>:
Rearrange the private method declarations in InlinedVector
PiperOrigin-RevId: 224202447
--
eed3c9f488f23b521bee41d3683eb6cc22517ded by Derek Mauro <dmauro@google.com>:
Fix leak_check target (it was always a no-op when LSAN isn't available).
Fixes https://github.com/abseil/abseil-cpp/issues/232
PiperOrigin-RevId: 224201634
--
fc08039e175204b14a9561f618fcfc0234586801 by Greg Falcon <gfalcon@google.com>:
Add parens around more invocations of min() and max() missed in my prior CL.
PiperOrigin-RevId: 224162430
--
0ec5476a8293c7796cd84928a1a558b14f14f222 by Abseil Team <absl-team@google.com>:
Update absl/numeric/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224139165
--
2b46aa6fabb20c589661f8bbc84030ecf39ce394 by Abseil Team <absl-team@google.com>:
Update absl/meta/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224117258
--
6c951c798f8c6903bd8793a8a4b5f69244be8aa9 by Abseil Team <absl-team@google.com>:
Fix 2 Unused C++ BUILD Dependencies
PiperOrigin-RevId: 224070093
--
0ee7bd191708708f91fc5209c197fd93f6e4a8b3 by Greg Falcon <gfalcon@google.com>:
Inside Abseil headers, wrap most invocations of methods and functions named `min` and `max` in parentheses, for better interoperability with Windows toolchains.
CCTZ fixes will appear in a follow-up CL.
PiperOrigin-RevId: 224051960
--
f562f56577b84a8bc07e5873775c01d068531bca by Jon Cohen <cohenjon@google.com>:
Generate Abseil compile options. The single source of truth is now absl/copts/copts.py
The way this works goes something like this:
copts.py acts as the configuration file. We use python because unlike JSON it allows comments. It has two maps in it: one from names to external flags, and one from names to internal flags.
generate_copts.py imports the maps and loops through them to write GENERATED_copts.bzl and GENERATED_AbseilCopts.cmake
AbseilConfigureCopts.cmake and configure_copts.bzl import their respective copts args and set the platform-appropriate copts into ABSL_DEFAULT_COPTS, ABSL_TEST_COPTS, ABSL_EXCEPTIONS_FLAG, and ABSL_EXCEPTIONS_LINKOPTS
For Bazel, each BUILD file load()s configure_copts.bzl
For CMake, AbseilHelpers.cmake include()s AbseilConfigureCopts.cmake to get the final copts and both inserts them as needed into legacy target rules and also makes them available to the rest of our CMakeLists.txt file. We may instead want to include() AbseilConfigureCopts.cmake directly into each CMakeLists.txt file for consistency, but I'm not sure what the deal is with cmake and include guards, or if they are even needed. That's also not as idiomatic -- CMake tends to use directory scope where globals set at a higher level CMakeLists.txt file are used in the subdirectory CMakeLists.txt files.
PiperOrigin-RevId: 224039419
--
f7402f6bb65037e668a7355f0a003f5c05a3b6a7 by Abseil Team <absl-team@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 224036622
GitOrigin-RevId: 22fa219d17b2281c0695642830c4300711bd65ea
Change-Id: I6b505360539ff2aef8aa30c51a5f7d55db1c75cf
2018-12-05 21:37:41 +01:00
|
|
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
2019-03-22 20:23:01 +01:00
|
|
|
set(ABSL_DEFAULT_COPTS "${ABSL_MSVC_FLAGS}")
|
|
|
|
set(ABSL_TEST_COPTS "${ABSL_MSVC_FLAGS};${ABSL_MSVC_TEST_FLAGS}")
|
2019-03-27 16:05:41 +01:00
|
|
|
set(ABSL_DEFAULT_LINKOPTS "${ABSL_MSVC_LINKOPTS}")
|
Export of internal Abseil changes.
--
22fa219d17b2281c0695642830c4300711bd65ea by CJ Johnson <johnsoncj@google.com>:
Rearrange the private method declarations in InlinedVector
PiperOrigin-RevId: 224202447
--
eed3c9f488f23b521bee41d3683eb6cc22517ded by Derek Mauro <dmauro@google.com>:
Fix leak_check target (it was always a no-op when LSAN isn't available).
Fixes https://github.com/abseil/abseil-cpp/issues/232
PiperOrigin-RevId: 224201634
--
fc08039e175204b14a9561f618fcfc0234586801 by Greg Falcon <gfalcon@google.com>:
Add parens around more invocations of min() and max() missed in my prior CL.
PiperOrigin-RevId: 224162430
--
0ec5476a8293c7796cd84928a1a558b14f14f222 by Abseil Team <absl-team@google.com>:
Update absl/numeric/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224139165
--
2b46aa6fabb20c589661f8bbc84030ecf39ce394 by Abseil Team <absl-team@google.com>:
Update absl/meta/CMakeLists.txt to use new functions
i.e. absl_cc_(library|test)
PiperOrigin-RevId: 224117258
--
6c951c798f8c6903bd8793a8a4b5f69244be8aa9 by Abseil Team <absl-team@google.com>:
Fix 2 Unused C++ BUILD Dependencies
PiperOrigin-RevId: 224070093
--
0ee7bd191708708f91fc5209c197fd93f6e4a8b3 by Greg Falcon <gfalcon@google.com>:
Inside Abseil headers, wrap most invocations of methods and functions named `min` and `max` in parentheses, for better interoperability with Windows toolchains.
CCTZ fixes will appear in a follow-up CL.
PiperOrigin-RevId: 224051960
--
f562f56577b84a8bc07e5873775c01d068531bca by Jon Cohen <cohenjon@google.com>:
Generate Abseil compile options. The single source of truth is now absl/copts/copts.py
The way this works goes something like this:
copts.py acts as the configuration file. We use python because unlike JSON it allows comments. It has two maps in it: one from names to external flags, and one from names to internal flags.
generate_copts.py imports the maps and loops through them to write GENERATED_copts.bzl and GENERATED_AbseilCopts.cmake
AbseilConfigureCopts.cmake and configure_copts.bzl import their respective copts args and set the platform-appropriate copts into ABSL_DEFAULT_COPTS, ABSL_TEST_COPTS, ABSL_EXCEPTIONS_FLAG, and ABSL_EXCEPTIONS_LINKOPTS
For Bazel, each BUILD file load()s configure_copts.bzl
For CMake, AbseilHelpers.cmake include()s AbseilConfigureCopts.cmake to get the final copts and both inserts them as needed into legacy target rules and also makes them available to the rest of our CMakeLists.txt file. We may instead want to include() AbseilConfigureCopts.cmake directly into each CMakeLists.txt file for consistency, but I'm not sure what the deal is with cmake and include guards, or if they are even needed. That's also not as idiomatic -- CMake tends to use directory scope where globals set at a higher level CMakeLists.txt file are used in the subdirectory CMakeLists.txt files.
PiperOrigin-RevId: 224039419
--
f7402f6bb65037e668a7355f0a003f5c05a3b6a7 by Abseil Team <absl-team@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 224036622
GitOrigin-RevId: 22fa219d17b2281c0695642830c4300711bd65ea
Change-Id: I6b505360539ff2aef8aa30c51a5f7d55db1c75cf
2018-12-05 21:37:41 +01:00
|
|
|
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}")
|
2019-03-22 20:23:01 +01:00
|
|
|
endif()
|