-
Notifications
You must be signed in to change notification settings - Fork 102
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
Configure CMake rules to install content into toolchain #531
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
44b417f
Configure CMake build to install content into toolchain
stmontgomery 543febd
Fix negated conditional to ensure the macro plugin is installed when …
stmontgomery 69e7171
Fix the macro install locations
stmontgomery 9f3328c
Use the correct library name for the macro plugin on Linux
stmontgomery 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 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 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 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 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 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 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,64 @@ | ||
# This source file is part of the Swift.org open source project | ||
# | ||
# Copyright (c) 2024 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 | ||
|
||
# Returns the os name in a variable | ||
# | ||
# Usage: | ||
# get_swift_host_os(result_var_name) | ||
# | ||
# | ||
# Sets ${result_var_name} with the converted OS name derived from | ||
# CMAKE_SYSTEM_NAME. | ||
function(get_swift_host_os result_var_name) | ||
set(${result_var_name} ${SWIFT_SYSTEM_NAME} PARENT_SCOPE) | ||
endfunction() | ||
|
||
function(_swift_testing_install_target module) | ||
get_swift_host_os(swift_os) | ||
get_target_property(type ${module} TYPE) | ||
|
||
if(type STREQUAL STATIC_LIBRARY) | ||
set(swift swift_static) | ||
else() | ||
set(swift swift) | ||
endif() | ||
|
||
install(TARGETS ${module} | ||
ARCHIVE DESTINATION lib/${swift}/${swift_os} | ||
LIBRARY DESTINATION lib/${swift}/${swift_os} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
if(type STREQUAL EXECUTABLE) | ||
return() | ||
endif() | ||
|
||
get_target_property(module_name ${module} Swift_MODULE_NAME) | ||
if(NOT module_name) | ||
set(module_name ${module}) | ||
endif() | ||
|
||
if(NOT SwiftTesting_MODULE_TRIPLE) | ||
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info) | ||
if(CMAKE_Swift_COMPILER_TARGET) | ||
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET}) | ||
endif() | ||
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json) | ||
string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple") | ||
set(SwiftTesting_MODULE_TRIPLE "${module_triple}" CACHE STRING "swift module triple used for installed swiftmodule and swiftinterface files") | ||
mark_as_advanced(SwiftTesting_MODULE_TRIPLE) | ||
endif() | ||
|
||
install(FILES $<TARGET_PROPERTY:${module},Swift_MODULE_DIRECTORY>/${module_name}.swiftdoc | ||
DESTINATION lib/${swift}/${swift_os}/${module_name}.swiftmodule | ||
RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftdoc) | ||
install(FILES $<TARGET_PROPERTY:${module},Swift_MODULE_DIRECTORY>/${module_name}.swiftmodule | ||
DESTINATION lib/${swift}/${swift_os}/${module_name}.swiftmodule | ||
RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftmodule) | ||
install(FILES $<TARGET_PROPERTY:${module},Swift_MODULE_DIRECTORY>/${module_name}.swiftinterface | ||
DESTINATION lib/${swift}/${swift_os}/${module_name}.swiftmodule | ||
RENAME ${SwiftTesting_MODULE_TRIPLE}.swiftinterface) | ||
endfunction() |
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.
Would it be possible for us to emit our private interface too, so that developers could use
@_spi
symbols?