Skip to content

Commit f720459

Browse files
authored
Merge pull request #23664 from nkcsgexi/install-oss-digester
cmake: install swift-api-digester and swift-api-checker into the OSS toolchain. SR-10220
2 parents 9b29b3b + db0f39f commit f720459

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

cmake/modules/SwiftComponents.cmake

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@
6161
# Xcode;
6262
# * tools -- tools (other than the compiler) useful for developers writing
6363
# Swift code.
64+
# * toolchain-tools -- a subset of tools that we will install to the OSS toolchain.
6465
# * testsuite-tools -- extra tools required to run the Swift testsuite.
6566
# * toolchain-dev-tools -- install development tools useful in a shared toolchain
6667
# * dev -- headers and libraries required to use Swift compiler as a library.
6768
set(_SWIFT_DEFINED_COMPONENTS
68-
"autolink-driver;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;stdlib;stdlib-experimental;sdk-overlay;parser-lib;editor-integration;tools;testsuite-tools;toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
69+
"autolink-driver;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;stdlib;stdlib-experimental;sdk-overlay;parser-lib;editor-integration;tools;testsuite-tools;toolchain-tools;toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
6970

7071
# The default install components include all of the defined components, except
7172
# for the following exceptions.
@@ -143,6 +144,24 @@ function(swift_install_in_component component)
143144
install(${ARGN})
144145
endfunction()
145146

147+
# swift_install_in_either_component(<COMPONENT1 NAME> <COMPONENT2 NAME>
148+
# <same parameters as install()>)
149+
#
150+
# Executes the specified installation actions if either one of the named
151+
# components is requested to be installed.
152+
#
153+
# This function accepts the same parameters as install().
154+
function(swift_install_in_either_component comp1 comp2)
155+
foreach(component ${comp1} ${comp2})
156+
precondition(component MESSAGE "Component name is required")
157+
swift_is_installing_component("${component}" is_installing)
158+
if(is_installing)
159+
install(${ARGN})
160+
return()
161+
endif()
162+
endforeach(component)
163+
endfunction()
164+
146165
function(swift_install_symlink_component component)
147166
cmake_parse_arguments(
148167
ARG # prefix

tools/swift-api-digester/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ add_swift_host_tool(swift-api-digester
33
ModuleAnalyzerNodes.cpp
44
ModuleDiagsConsumer.cpp
55
SWIFT_COMPONENT tools
6+
SWIFT_COMPONENT toolchain-tools
67
)
78
target_link_libraries(swift-api-digester
89
PRIVATE

utils/api_checker/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
swift_install_in_component(tools
1+
swift_install_in_either_component(tools toolchain-tools
22
FILES "swift-api-checker.py"
33
DESTINATION "bin")
4-
swift_install_in_component(tools
4+
swift_install_in_either_component(tools toolchain-tools
55
DIRECTORY "sdk-module-lists"
66
DESTINATION "bin")

utils/build-presets.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
[preset: mixin_buildbot_install_components]
1717
dash-dash
1818

19-
swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;testsuite-tools;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers;
19+
swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;toolchain-tools;testsuite-tools;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers;
2020

2121

2222
[preset: mixin_buildbot_trunk_base]
@@ -736,7 +736,7 @@ install-swiftpm
736736
install-xctest
737737
install-libicu
738738
install-prefix=/usr
739-
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;license;sourcekit-inproc
739+
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-inproc
740740
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
741741
install-libcxx
742742
build-swift-static-stdlib
@@ -1129,7 +1129,7 @@ test-installable-package
11291129
# If someone uses this for incremental builds, force reconfiguration.
11301130
reconfigure
11311131

1132-
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
1132+
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
11331133
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
11341134
install-libcxx
11351135

0 commit comments

Comments
 (0)