Skip to content

Commit 446db97

Browse files
committed
[CMake] Check if a cmake variable 'SWIFT_INSTALL_EXCLUDE_[component]' is set for a component.
In which case the 'SWIFT_INSTALL_[component]' will be FALSE. This is useful to get the behavior where all components are set to install by default and exclude just a specific one.
1 parent 292e6a9 commit 446db97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmake/modules/SwiftComponents.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ macro(swift_configure_components)
8585

8686
string(TOUPPER "${component}" var_name_piece)
8787
string(REPLACE "-" "_" var_name_piece "${var_name_piece}")
88-
set(SWIFT_INSTALL_${var_name_piece} TRUE)
88+
if("${SWIFT_INSTALL_EXCLUDE_${var_name_piece}}" STREQUAL "")
89+
set(SWIFT_INSTALL_EXCLUDE_${var_name_piece} FALSE)
90+
endif()
91+
if(NOT ${SWIFT_INSTALL_EXCLUDE_${var_name_piece}})
92+
set(SWIFT_INSTALL_${var_name_piece} TRUE)
93+
endif()
8994
endforeach()
9095
endmacro()
9196

0 commit comments

Comments
 (0)