summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-25 20:42:19 +0000
committerZachary Turner <zturner@google.com>2015-02-25 20:42:19 +0000
commit66bc9080d6d5ef4904f25d70c374a3dc2c218c9f (patch)
tree48d56e7484fd2eddae1c641a71e58d3134d6e1b0 /llvm/cmake/modules/AddLLVM.cmake
parent4a2ceea193c55ffb37879b6e07c843cef8299b3d (diff)
downloadbcm5719-llvm-66bc9080d6d5ef4904f25d70c374a3dc2c218c9f.tar.gz
bcm5719-llvm-66bc9080d6d5ef4904f25d70c374a3dc2c218c9f.zip
[CMake] Fix the clang-cl self host build.
This allows clang-cl to self-host cleanly with no magic setup steps required. After this patch, all you have to do is set CC=CXX=clang-cl and run cmake -G Ninja. These changes only exist to support C++ features which are unsupported in clang-cl, so regardless of whether the user specifies they want to use them, we still have to disable them. llvm-svn: 230539
Diffstat (limited to 'llvm/cmake/modules/AddLLVM.cmake')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 780839d5c4f..7f6364428ca 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -10,7 +10,7 @@ function(llvm_update_compile_flags name)
# LLVM_REQUIRES_EH is an internal flag that individual
# targets can use to force EH
- if(LLVM_REQUIRES_EH OR LLVM_ENABLE_EH)
+ if((LLVM_REQUIRES_EH OR LLVM_ENABLE_EH) AND NOT CLANG_CL)
if(NOT (LLVM_REQUIRES_RTTI OR LLVM_ENABLE_RTTI))
message(AUTHOR_WARNING "Exception handling requires RTTI. Enabling RTTI for ${name}")
set(LLVM_REQUIRES_RTTI ON)
@@ -22,6 +22,10 @@ function(llvm_update_compile_flags name)
list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")
endif()
+ if (CLANG_CL)
+ # FIXME: Remove this once clang-cl supports SEH
+ list(APPEND LLVM_COMPILE_DEFINITIONS "GTEST_HAS_SEH=0")
+ endif()
endif()
# LLVM_REQUIRES_RTTI is an internal flag that individual
OpenPOWER on IntegriCloud