Skip to content

[6.0] Add option to install targets even when not top level #2637

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

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/modules/AddSwiftHostLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function(add_swift_syntax_library name)
endif()
endif()

if(PROJECT_IS_TOP_LEVEL)
if(PROJECT_IS_TOP_LEVEL OR SWIFT_SYNTAX_INSTALL_TARGETS)
# Install this target
install(TARGETS ${name}
EXPORT SwiftSyntaxTargets
Expand All @@ -148,4 +148,5 @@ function(add_swift_syntax_library name)
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
endif()
add_library(SwiftSyntax::${name} ALIAS ${name})
endfunction()
2 changes: 1 addition & 1 deletion cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(PROJECT_IS_TOP_LEVEL)
if(PROJECT_IS_TOP_LEVEL OR SWIFT_SYNTAX_INSTALL_TARGETS)
export(EXPORT SwiftSyntaxTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/SwiftSyntaxConfig.cmake
NAMESPACE SwiftSyntax::)
Expand Down