-
Notifications
You must be signed in to change notification settings - Fork 475
build: add support for nesting the Swift subdirectory #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2d70580
build: remove cross-compilation support
compnerd 31d3ff1
build: bump CMake minimum requirement and drop workaround
compnerd dab742d
build: simplify option handling slightly
compnerd afe36b7
build: bring `config.h.in` into sync with checked in copy
compnerd 09c2ade
build: simplify system checks (NFC)
compnerd 78285e0
build: adopt current best practices for installing modules
compnerd ec9bb34
build: remove outdated TODO, limit build, install
compnerd a7657b1
build: remove unnecessary policy adjustment
compnerd 4d6b449
build: use more global properties
compnerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This source file is part of the Swift.org open source project | ||
# | ||
# Copyright (c) 2025 Apple Inc. and the Swift project authors | ||
# Licensed under Apache License v2.0 with Runtime Library Exception | ||
# | ||
# See http://swift.org/LICENSE.txt for license information | ||
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
|
||
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info) | ||
if(CMAKE_Swift_COMPILER_TARGET) | ||
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET}) | ||
endif() | ||
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json) | ||
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n" | ||
"${target_info_json}") | ||
|
||
if(NOT Dispatch_MODULE_TRIPLE) | ||
string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple") | ||
set(Dispatch_MODULE_TRIPLE "${module_triple}" CACHE STRING "Triple used for installed swift{doc,module,interface} files") | ||
mark_as_advanced(Dispatch_MODULE_TRIPLE) | ||
|
||
message(CONFIGURE_LOG "Swift Module Triple: ${module_triple}") | ||
endif() | ||
|
||
if(NOT Dispatch_PLATFORM_SUBDIR) | ||
string(JSON platform GET "${target_info_json}" "target" "platform") | ||
if(NOT platform) | ||
if(NOT SWIFT_SYSTEM_NAME) | ||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin) | ||
set(platform macosx) | ||
else() | ||
set(platform $<LOWER_CASE:${CMAKE_SYSTEM_NAME}>) | ||
endif() | ||
endif() | ||
endif() | ||
set(Dispatch_PLATFORM_SUBDIR "${platform}" CACHE STRING "Platform name used for installed swift{doc,module,interface} files") | ||
mark_as_advanced(Dispatch_PLATFORM_SUBDIR) | ||
|
||
message(CONFIGURE_LOG "Swift Platform: ${platform}") | ||
endif() | ||
|
||
if(NOT Dispatch_ARCH_SUBDIR) | ||
string(JSON arch GET "${target_info_json}" "target" "arch") | ||
set(Dispatch_ARCH_SUBDIR "${arch}" CACHE STRING "Architecture used for setting the architecture subdirectory") | ||
mark_as_advanced(Dispatch_ARCH_SUBDIR) | ||
|
||
message(CONFIGURE_LOG "Swift Architecture: ${arch}") | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this commented out for a reason? Do we want a TODO here to enable installing the interface once interfaces work without stability, or should this code be deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is something that we want to enable in the future. It requires adding new options, and I was trying to keep the flags the same as they were, just changing the install location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, maybe leave a FIXME/TODO comment so that we know what was intended.