llvm.org GIT mirror llvm / 4ec9567
[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 Chris Bieneman 4 years ago
1 changed file(s) with 19 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
8989 endif()
9090
9191 get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS)
92 list(REMOVE_DUPLICATES SUB_COMPONENTS)
93 foreach(component ${SUB_COMPONENTS})
94 if(NOT TARGET ${component})
95 message(SEND_ERROR "Missing target for runtime component ${component}!")
96 continue()
97 endif()
98 if(LLVM_INCLUDE_TESTS AND NOT TARGET check-${component})
99 message(SEND_ERROR "Missing check target for runtime component ${component}!")
100 continue()
101 endif()
92 if(SUB_COMPONENTS)
93 list(REMOVE_DUPLICATES SUB_COMPONENTS)
94 foreach(component ${SUB_COMPONENTS})
95 if(NOT TARGET ${component})
96 message(SEND_ERROR "Missing target for runtime component ${component}!")
97 continue()
98 endif()
99 if(LLVM_INCLUDE_TESTS AND NOT TARGET check-${component})
100 message(SEND_ERROR "Missing check target for runtime component ${component}!")
101 continue()
102 endif()
102103
103 if(TARGET install-${component})
104 list(APPEND SUB_INSTALL_TARGETS install-${component})
105 endif()
106 endforeach()
104 if(TARGET install-${component})
105 list(APPEND SUB_INSTALL_TARGETS install-${component})
106 endif()
107 endforeach()
107108
108 configure_file(
109 ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
110 ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
109 configure_file(
110 ${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
111 ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
112 endif()
111113
112114 else() # if this is included from LLVM's CMake
113115 include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL)