浏览代码

[CMake] Let ExceptionDemo buildable with ENABLE_EH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246152 91177308-0d34-0410-b5e6-96231b3b80d8
NAKAMURA Takumi 10 年之前
父节点
当前提交
251477e918
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      examples/CMakeLists.txt
  2. 4 4
      examples/ExceptionDemo/CMakeLists.txt

+ 1 - 1
examples/CMakeLists.txt

@@ -4,7 +4,7 @@ add_subdirectory(HowToUseJIT)
 add_subdirectory(Kaleidoscope)
 add_subdirectory(Kaleidoscope)
 add_subdirectory(ModuleMaker)
 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)
     add_subdirectory(ExceptionDemo)
 endif()
 endif()
 
 

+ 4 - 4
examples/ExceptionDemo/CMakeLists.txt

@@ -5,14 +5,14 @@ set(LLVM_LINK_COMPONENTS
   MCJIT
   MCJIT
   RuntimeDyld
   RuntimeDyld
   Support
   Support
+  Target
   nativecodegen
   nativecodegen
   )
   )
 
 
 # Enable EH and RTTI for this demo
 # 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
 add_llvm_example(ExceptionDemo
   ExceptionDemo.cpp
   ExceptionDemo.cpp