diff options
author | Dane Springmeyer <springmeyer@users.noreply.github.com> | 2018-04-30 12:46:17 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-05-02 10:28:40 -0700 |
commit | 29214902b5734361c534a985ac8fe559d8bf5b00 (patch) | |
tree | 5d42f1583646aebcacd4c1ef774c7c83f13704d0 /CMakeLists.txt | |
parent | ba9b49cb997ba6cd119242be9209c7a16d53bd40 (diff) | |
download | qtlocation-mapboxgl-29214902b5734361c534a985ac8fe559d8bf5b00.tar.gz |
Fix CXX11ABI builds with clang++
The intention of the `WITH_CXX11ABI` option is to allow the user to control toggle whether to compile against the CXX11ABI in libstdc++ (and whether to download a few specific CXX11ABI compatible mason packages as well).
This option is important if you are building binaries (like the node binaries) and you want to support a platform that is older and does not have a recent enough libstdc++ to support the CXX11ABI (like ubuntu:precise, centos6, etc).
But this was broken for clang++ builds due to the use of `MAKE_COMPILER_IS_GNUCXX`. That was preventing the correct flags from being set when using clang++ effectively making the option useless and resulting in the build defaulting to whatever the libstdc++-dev headers default is on the system (which varies per linux distribution based on how libstdc++-dev is packaged).
This fixes the problem by ensuring that clang++ builds still support toggling control over this option.
Note: clang++ > 3.9 supports targeting both the new CXX11ABI in libstdc++ (with `-D_GLIBCXX_USE_CXX11_ABI=1`) and targeting the old one (with `-D_GLIBCXX_USE_CXX11_ABI=0`).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8307191a3f..46aea73356 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,13 +15,9 @@ include(cmake/xcode.cmake) if(WITH_CXX11ABI) set(MASON_CXXABI_SUFFIX -cxx11abi) - if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) - endif() + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) else() - if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) - endif() + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) endif() if(WITH_OSMESA AND WITH_EGL) |