-get_filename_component(cxx_base "${CMAKE_CXX_COMPILER}" NAME_WE)
-if(cxx_base MATCHES "^clang(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\+\\+)?$")
- set(STD_STRING_USES_COW)
+# Check whether STL is libstdc++
+check_cxx_source_compiles(
+ "
+ #include <vector>
+ int main() {
+ #if ! defined(__GLIBCXX__) && ! defined(__GLIBCPP__)
+ this is not libstdc++
+ #endif
+ return(0);
+ }
+ "
+lyx_cv_lib_stdcxx)
+
+# Check whether STL is libstdc++ with C++11 ABI
+check_cxx_source_compiles(
+ "
+ #include <vector>
+ int main() {
+ #if ! defined(_GLIBCXX_USE_CXX11_ABI) || ! _GLIBCXX_USE_CXX11_ABI
+ this is not libstdc++ using the C++11 ABI
+ #endif
+ return(0);
+ }
+ "
+USE_GLIBCXX_CXX11_ABI)
+
+check_cxx_source_compiles(
+ "
+ #ifndef __clang__
+ this is not clang
+ #endif
+ int main() {
+ return(0);
+ }
+ "
+lyx_cv_prog_clang)
+
+check_cxx_source_compiles(
+ "
+ #include <memory>
+ using std::make_unique;
+ int main() {
+ return(0);
+ }
+ "
+HAVE_DEF_MAKE_UNIQUE)
+
+check_cxx_source_compiles(
+ "
+ #include <mutex>
+ static std::once_flag flag;
+ int main() {
+ std::call_once(flag, [](){ return; });
+ return(0);
+ }
+ "
+LYX_USE_STD_CALL_ONCE)
+
+set(USE_LLVM_LIBCPP)
+set(STD_STRING_USES_COW)
+set(USE_GLIBCXX_CXX11_ABI)
+if(lyx_cv_lib_stdcxx)
+ if(NOT USE_GLIBCXX_CXX11_ABI)
+ set(STD_STRING_USES_COW 1)
+ endif()