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)