Skip to content

Commit 54acc5e

Browse files
authored
[CMake] StandaloneOverlay: set components before including apinotes/ (#22601)
Otherwise, we'll think we don't need to install the API notes. No test because this configuration isn't (yet) tested publicly anywhere, but it is being tested within Apple. (cherry picked from commit bc35b34)
1 parent a13defd commit 54acc5e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

apinotes/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ add_custom_target("copy_apinotes"
2828
COMMENT "Copying API notes to ${output_dir}"
2929
SOURCES "${sources}")
3030

31+
# This is treated as an OPTIONAL target because if we don't build the SDK
32+
# overlay, the files will be missing anyway. It also allows us to build
33+
# single overlays without installing the API notes.
3134
swift_install_in_component(sdk-overlay
32-
FILES ${sources}
33-
DESTINATION "lib/swift/apinotes")
35+
DIRECTORY "${output_dir}"
36+
DESTINATION "lib/swift/"
37+
OPTIONAL)

cmake/modules/StandaloneOverlay.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ precondition(SWIFT_DEST_ROOT)
5959
precondition(SWIFT_HOST_VARIANT_SDK)
6060
precondition(TOOLCHAIN_DIR)
6161

62+
# Without this line, installing components is broken. This needs refactoring.
63+
swift_configure_components()
64+
6265
# Some overlays include the runtime's headers,
6366
# and some of those headers are generated at build time.
6467
add_subdirectory("${SWIFT_SOURCE_DIR}/include" "${SWIFT_SOURCE_DIR}/include")
6568
add_subdirectory("${SWIFT_SOURCE_DIR}/apinotes" "${SWIFT_SOURCE_DIR}/apinotes")
6669

67-
# Without this line, installing components is broken. This needs refactoring.
68-
swift_configure_components()
69-
7070
precondition(unknown_sdks NEGATE MESSAGE "Unknown SDKs: ${unknown_sdks}")
7171
precondition(SWIFT_CONFIGURED_SDKS MESSAGE "No SDKs selected.")
7272
precondition(SWIFT_HOST_VARIANT_SDK MESSAGE "No SDK for host tools.")

0 commit comments

Comments
 (0)