summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-05-10 16:17:43 +0000
committerEric Fiselier <eric@efcs.ca>2016-05-10 16:17:43 +0000
commita5e201fd5570baa620cd266a73c156420f471ba8 (patch)
tree6cbe35a6bb670db7eb82cf6f5faf32b2e66a9c00 /libcxx/cmake
parent129fba7fb64dc003b822f801964647983f132f7f (diff)
downloadbcm5719-llvm-a5e201fd5570baa620cd266a73c156420f471ba8.tar.gz
bcm5719-llvm-a5e201fd5570baa620cd266a73c156420f471ba8.zip
[libcxx] Prefer C++14 over C++11 when building libc++experimental.
Summary: Currently libc++experimental builds with C++11. This patch changes that to C++14 when supported by the compiler. Although nothing currently requires C++14 the upcoming <experimental/memory_resource> implementation would benefit from it. [1] Note that libc++.so continues to build with C++11 and is unaffected by this change. [1] <experimental/memory_resource> provides global resources which must exist for the entire lifetime of the program. In order to ensure that a global resource can be used during program termination there destructors must never be invoked. The only way to do this, while also allowing "constant initialization", is to use a C++14 union. Reviewers: mclow.lists Subscribers: pete, cfe-commits Differential Revision: http://reviews.llvm.org/D19992 llvm-svn: 269070
Diffstat (limited to 'libcxx/cmake')
-rw-r--r--libcxx/cmake/Modules/HandleLibcxxFlags.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
index bb886fa8a01..b8ea1344644 100644
--- a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
+++ b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake
@@ -35,6 +35,11 @@ macro(remove_flags)
endforeach()
endmacro(remove_flags)
+macro(check_flag_supported flag)
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+endmacro()
+
# Add a macro definition if condition is true.
macro(define_if condition def)
if (${condition})
OpenPOWER on IntegriCloud