diff options
author | Shoaib Meenai <smeenai@fb.com> | 2017-10-04 23:44:38 +0000 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2017-10-04 23:44:38 +0000 |
commit | 36d0ee6c87d3a32a3bd406806e330b13a6ce3133 (patch) | |
tree | b6572c370686a335b38fd41b6efe00c9989f4e9a /CMakeLists.txt | |
parent | 2b7279cb08dbec4ff3561b0714f62f887fc8f34d (diff) |
[libc++] Allow users to explicitly specify ABI
libc++'s current heuristic for detecting Itanium vs. Microsoft ABI falls
short in some cases. For example, it will detect windows-itanium targets
as using the Microsoft ABI, since they set `_MSC_VER` (for compatibility
with Microsoft headers). Leave the current heuristic in place by default
but also allow users to explicitly specify the ABI if need be.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314949 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b111a871..ccf4b969b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,8 @@ cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF) set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.") option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF) +option(LIBCXX_ABI_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.") +option(LIBCXX_ABI_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.") option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC) @@ -337,6 +339,10 @@ if (LIBCXX_HAS_MUSL_LIBC AND NOT LIBCXX_INSTALL_SUPPORT_HEADERS) "when building for Musl with LIBCXX_HAS_MUSL_LIBC.") endif() +if (LIBCXX_ABI_ITANIUM AND LIBCXX_ABI_MICROSOFT) + message(FATAL_ERROR "Only one of LIBCXX_ABI_ITANIUM and LIBCXX_ABI_MICROSOFT can be specified.") +endif () + #=============================================================================== # Configure System #=============================================================================== @@ -594,6 +600,8 @@ if (NOT LIBCXX_ABI_VERSION EQUAL "1") config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION) endif() config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE) +config_define_if(LIBCXX_ABI_ITANIUM _LIBCPP_ABI_ITANIUM) +config_define_if(LIBCXX_ABI_MICROSOFT _LIBCPP_ABI_MICROSOFT) config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN) |