[CMake] Let ExceptionDemo buildable with ENABLE_EH.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 27 Aug 2015 15:13:14 +0000 (15:13 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 27 Aug 2015 15:13:14 +0000 (15:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246152 91177308-0d34-0410-b5e6-96231b3b80d8

examples/CMakeLists.txt
examples/ExceptionDemo/CMakeLists.txt

index f98c403deb0b90ef3d6e9d8f73642374c44d847d..5727066d6227b37e3615a9bc057a9cbf703322ca 100644 (file)
@@ -4,7 +4,7 @@ add_subdirectory(HowToUseJIT)
 add_subdirectory(Kaleidoscope)
 add_subdirectory(ModuleMaker)
 
-if( ( NOT WIN32 ) AND ( NOT "${LLVM_NATIVE_ARCH}" STREQUAL "ARM" ) )
+if(LLVM_ENABLE_EH AND (NOT WIN32) AND (NOT "${LLVM_NATIVE_ARCH}" STREQUAL "ARM"))
     add_subdirectory(ExceptionDemo)
 endif()
 
index b4354f66f0d6697e0e6eaf9198368af65820d7f5..793cf291ca6f110eae23c396e24c2ee3cd050bcd 100644 (file)
@@ -5,14 +5,14 @@ set(LLVM_LINK_COMPONENTS
   MCJIT
   RuntimeDyld
   Support
+  Target
   nativecodegen
   )
 
 # Enable EH and RTTI for this demo
-set(LLVM_REQUIRES_EH 1)
-set(LLVM_REQUIRES_RTTI 1)
-
-set(LLVM_BUILD_EXAMPLES OFF)
+if(NOT LLVM_ENABLE_EH)
+  message(FATAL_ERROR "ExceptionDemo must require EH.")
+endif()
 
 add_llvm_example(ExceptionDemo
   ExceptionDemo.cpp