Let a target specify whether it wants an assembly printer to be the MC version
[oota-llvm.git] / CMakeLists.txt
index 6fbaa5d45496a1560e00365703647e5febf4f2f5..8ad68a0457e5136bbaa62dcecf7782816bb4ac0a 100644 (file)
@@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
   )
 
-set(PACKAGE_VERSION "2.8")
+set(PACKAGE_VERSION "2.9")
 include(VersionFromVCS)
 add_version_info_from_vcs(PACKAGE_VERSION)
 
@@ -66,6 +66,7 @@ set(LLVM_ALL_TARGETS
   MSP430
   PIC16
   PowerPC
+  PTX
   Sparc
   SystemZ
   X86
@@ -272,7 +273,6 @@ add_subdirectory(lib/System)
 
 # Everything else depends on Support and System:
 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
-set(LLVM_COMMON_LIBS LLVMSupport LLVMSystem)
 
 set(LLVM_TABLEGEN "tblgen" CACHE
   STRING "Native TableGen executable. Saves building one when cross-compiling.")
@@ -306,7 +306,6 @@ add_subdirectory(lib/Analysis/IPA)
 add_subdirectory(lib/MC)
 add_subdirectory(lib/MC/MCParser)
 add_subdirectory(lib/MC/MCDisassembler)
-add_subdirectory(test)
 
 add_subdirectory(utils/FileCheck)
 add_subdirectory(utils/count)
@@ -338,6 +337,11 @@ foreach(t ${LLVM_TARGETS_TO_BUILD})
   set(CURRENT_LLVM_TARGET)
 endforeach(t)
 
+# PIC16 contains an odd library:
+if( LLVM_TARGETS_TO_BUILD MATCHES ".*PIC16.*" )
+  add_subdirectory(lib/Target/PIC16/PIC16Passes)
+endif()
+
 # Produce llvm/Config/AsmPrinters.def
 configure_file(
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
@@ -365,19 +369,31 @@ add_subdirectory(lib/Archive)
 
 add_subdirectory(projects)
 
-option(LLVM_BUILD_TOOLS "Build LLVM tool programs." ON)
-add_subdirectory(tools)
+option(LLVM_BUILD_TOOLS
+  "Build the LLVM tools. If OFF, just generate build targets." ON)
+option(LLVM_INCLUDE_TOOLS "Generate build targets for the LLVM tools." ON)
+if( LLVM_INCLUDE_TOOLS )
+  add_subdirectory(tools)
+endif()
+
+option(LLVM_BUILD_EXAMPLES
+  "Build the LLVM example programs. If OFF, just generate build targets." OFF)
+option(LLVM_INCLUDE_EXAMPLES "Generate build targets for the LLVM examples" ON)
+if( LLVM_INCLUDE_EXAMPLES )
+  add_subdirectory(examples)
+endif()
 
-option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
-add_subdirectory(examples)
+option(LLVM_BUILD_TESTS
+  "Build LLVM unit tests. If OFF, just generate build targes." OFF)
+option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
+if( LLVM_INCLUDE_TESTS )
+  add_subdirectory(test)
+  add_subdirectory(utils/unittest)
+  add_subdirectory(unittests)
+endif()
 
 add_subdirectory(cmake/modules)
 
-install(EXPORT LLVM
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm/
-  FILE LLVMTargets.cmake
-  )
-
 install(DIRECTORY include/
   DESTINATION include
   FILES_MATCHING