summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-02-23 19:07:25 +0000
committerReid Kleckner <reid@kleckner.net>2015-02-23 19:07:25 +0000
commite13b76591e0016c4683c6654b61dd6df44e18129 (patch)
tree8ca6effbca2c8be887d22c20e8459b3419e4d4cb /llvm/cmake/modules
parentcd3ca6f7dd8122254ec1165d893a73e4679baf3c (diff)
downloadbcm5719-llvm-e13b76591e0016c4683c6654b61dd6df44e18129.tar.gz
bcm5719-llvm-e13b76591e0016c4683c6654b61dd6df44e18129.zip
cmake: Don't do the libstdc++ version check when clang simulates MSVC
If we're using clang-cl, that's a pretty good indication that we're going to use MSVC's STL. This simplifies the clang-cl ninja self-host configuration down to: CC=clang-cl CXX=clang-cl cmake .. -GNinja Modified version of zturner's patch: Differential Revision: http://reviews.llvm.org/D7824 llvm-svn: 230239
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index ba6114a4f56..14fda9284c9 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -21,11 +21,15 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
message(FATAL_ERROR "Host Clang version must be at least 3.1!")
endif()
- # Also test that we aren't using too old of a version of libstdc++ with the
- # Clang compiler. This is tricky as there is no real way to check the
- # version of libstdc++ directly. Instead we test for a known bug in
- # libstdc++4.6 that is fixed in libstdc++4.7.
- if(NOT LLVM_ENABLE_LIBCXX)
+ if (CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
+ if (CMAKE_CXX_SIMULATE_VERSION VERSION_LESS 18.0)
+ message(FATAL_ERROR "Host Clang must have at least -fms-compatibility-version=18.0")
+ endif()
+ elseif(NOT LLVM_ENABLE_LIBCXX)
+ # Otherwise, test that we aren't using too old of a version of libstdc++
+ # with the Clang compiler. This is tricky as there is no real way to
+ # check the version of libstdc++ directly. Instead we test for a known
+ # bug in libstdc++4.6 that is fixed in libstdc++4.7.
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
OpenPOWER on IntegriCloud