[llvm-commits] [llvm] r58951 - /llvm/trunk/CMakeLists.txt
Oscar Fuentes
ofv at wanadoo.es
Sun Nov 9 17:47:07 PST 2008
Author: ofv
Date: Sun Nov 9 19:47:07 2008
New Revision: 58951
URL: http://llvm.org/viewvc/llvm-project?rev=58951&view=rev
Log:
CMake: Implement magic word `all' for selecting all targets. Check
that specified targets are known.
Modified:
llvm/trunk/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=58951&r1=58950&r2=58951&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Sun Nov 9 19:47:07 2008
@@ -13,15 +13,42 @@
set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
+set(LLVM_ALL_TARGETS
+ Alpha
+ ARM
+ CBackend
+ CellSPU
+ CppBackend
+ IA64
+ Mips
+ MSIL
+ PIC16
+ PowerPC
+ Sparc
+ X86
+ XCore
+ )
+
if( MSVC )
set(LLVM_TARGETS_TO_BUILD X86
- CACHE STRING "Semicolon-separated list of targets to build")
+ CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else( MSVC )
- set(LLVM_TARGETS_TO_BUILD
- Alpha ARM CBackend CellSPU CppBackend IA64 Mips MSIL PIC16 PowerPC Sparc X86 XCore
- CACHE STRING "Semicolon-separated list of targets to build")
+ set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS}
+ CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif( MSVC )
+if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
+ set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
+endif()
+
+foreach(c ${LLVM_TARGETS_TO_BUILD})
+ list(FIND LLVM_ALL_TARGETS ${c} idx)
+ if( idx LESS 0 )
+ message(FATAL_ERROR "The target `${c}' does not exists.
+ It should be one of\n${LLVM_ALL_TARGETS}")
+ endif()
+endforeach(c)
+
set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
# Add path for custom modules
More information about the llvm-commits
mailing list