summaryrefslogtreecommitdiff
path: root/runtimes/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-08-27 00:19:51 +0000
committerChris Bieneman <beanz@apple.com>2016-08-27 00:19:51 +0000
commit4ec9567b37d4d945497ccd546c3d78e9e8a3da2e (patch)
tree307a781ce316e2df9038378f3f4ac97d98451dd9 /runtimes/CMakeLists.txt
parentfd6bad6c387562e8dc4098116a91cd7ac0381eb1 (diff)
[CMake] Only generate Components.cmake if components are specified
Generating the Components import file is useless if there are no components coming in from the runtimes configuration, so we should skip generation in that case. This also should fix the configuration error that Renato reported on llvm-dev. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtimes/CMakeLists.txt')
-rw-r--r--runtimes/CMakeLists.txt38
1 files changed, 20 insertions, 18 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 139f6034e13..4d0747680a4 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -90,25 +90,27 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
endif()
get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS)
- list(REMOVE_DUPLICATES SUB_COMPONENTS)
- foreach(component ${SUB_COMPONENTS})
- if(NOT TARGET ${component})
- message(SEND_ERROR "Missing target for runtime component ${component}!")
- continue()
- endif()
- if(LLVM_INCLUDE_TESTS AND NOT TARGET check-${component})
- message(SEND_ERROR "Missing check target for runtime component ${component}!")
- continue()
- endif()
-
- if(TARGET install-${component})
- list(APPEND SUB_INSTALL_TARGETS install-${component})
- endif()
- endforeach()
+ if(SUB_COMPONENTS)
+ list(REMOVE_DUPLICATES SUB_COMPONENTS)
+ foreach(component ${SUB_COMPONENTS})
+ if(NOT TARGET ${component})
+ message(SEND_ERROR "Missing target for runtime component ${component}!")
+ continue()
+ endif()
+ if(LLVM_INCLUDE_TESTS AND NOT TARGET check-${component})
+ message(SEND_ERROR "Missing check target for runtime component ${component}!")
+ continue()
+ endif()
+
+ if(TARGET install-${component})
+ list(APPEND SUB_INSTALL_TARGETS install-${component})
+ endif()
+ endforeach()
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
- ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
+ ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
+ endif()
else() # if this is included from LLVM's CMake
include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL)