diff options
| author | Oscar Fuentes <ofv@wanadoo.es> | 2008-11-10 01:47:07 +0000 |
|---|---|---|
| committer | Oscar Fuentes <ofv@wanadoo.es> | 2008-11-10 01:47:07 +0000 |
| commit | e9edc2cd15af05688e257a8b334f40f7170db171 (patch) | |
| tree | 786ce99e15a387b5b224bc0218d1abb59f1d1950 | |
| parent | e352ca077c3bd491f667b58eb6adb2ac2ec56034 (diff) | |
| download | bcm5719-llvm-e9edc2cd15af05688e257a8b334f40f7170db171.tar.gz bcm5719-llvm-e9edc2cd15af05688e257a8b334f40f7170db171.zip | |
CMake: Implement magic word `all' for selecting all targets. Check
that specified targets are known.
llvm-svn: 58951
| -rw-r--r-- | llvm/CMakeLists.txt | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index ac7da6554d2..7f477ad143e 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -13,15 +13,42 @@ set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) 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 |

