Make the C++11/C++14 switch depend on the target OS to apply globally
The previous fix in https://chromium-review.googlesource.com/623528 did not resolve the problem with the Android build, because apparently `is_android` can be both true and false at different stages of the build, due to it being a cross-compile. Bug: webrtc:8109 Change-Id: I810398b17824f03c30aa53c8dfe23428657d1957 Reviewed-on: https://chromium-review.googlesource.com/628057 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Henrik Kjellander <kjellander@chromium.org> Commit-Queue: Oleh Prypin <oprypin@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#496658} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: c640649c92c185e05f03ba9e157fd3d3d45f0701
This commit is contained in:
Родитель
b696620bfa
Коммит
f9ec89f904
|
@ -454,7 +454,7 @@ config("compiler") {
|
|||
# C11/C++11 compiler flags setup.
|
||||
# ---------------------------
|
||||
if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") {
|
||||
if (is_android) {
|
||||
if (target_os == "android") {
|
||||
cxx11_override = use_cxx11_on_android
|
||||
} else {
|
||||
cxx11_override = use_cxx11
|
||||
|
@ -472,12 +472,18 @@ config("compiler") {
|
|||
cflags_cc += [ "-std=gnu++14" ]
|
||||
}
|
||||
} else if (!is_win && !is_nacl) {
|
||||
if (target_os == "android") {
|
||||
cxx11_override = use_cxx11_on_android
|
||||
} else {
|
||||
cxx11_override = use_cxx11
|
||||
}
|
||||
|
||||
# TODO(mcgrathr) - the NaCl GCC toolchain doesn't support either gnu11/gnu++11
|
||||
# or c11/c++11; we technically don't need this toolchain any more, but there
|
||||
# are still a few buildbots using it, so until those are turned off
|
||||
# we need the !is_nacl clause and the (is_nacl && is_clang) clause, above.
|
||||
cflags_c += [ "-std=c11" ]
|
||||
if (use_cxx11) {
|
||||
if (cxx11_override) {
|
||||
cflags_cc += [ "-std=c++11" ]
|
||||
} else {
|
||||
cflags_cc += [ "-std=c++14" ]
|
||||
|
|
Загрузка…
Ссылка в новой задаче