mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,11 +21,15 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
|
|||||||
message(FATAL_ERROR "Host Clang version must be at least 3.1!")
|
message(FATAL_ERROR "Host Clang version must be at least 3.1!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Also test that we aren't using too old of a version of libstdc++ with the
|
if (CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
|
||||||
# Clang compiler. This is tricky as there is no real way to check the
|
if (CMAKE_CXX_SIMULATE_VERSION VERSION_LESS 18.0)
|
||||||
# version of libstdc++ directly. Instead we test for a known bug in
|
message(FATAL_ERROR "Host Clang must have at least -fms-compatibility-version=18.0")
|
||||||
# libstdc++4.6 that is fixed in libstdc++4.7.
|
endif()
|
||||||
if(NOT LLVM_ENABLE_LIBCXX)
|
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_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
|
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
|
||||||
|
Reference in New Issue
Block a user