Skip to content

Commit 998ce5b

Browse files
committed
[CMake] Give a dedicated component to compiler swift-syntax libraries
'compiler-swift-syntax-lib' so projects statically link to compiler libraries (libAST etc) can use the required shared libraries.
1 parent 0bd4e4e commit 998ce5b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cmake/modules/SwiftComponents.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
# * autolink-driver -- the Swift driver support tools
4949
# * back-deployment -- Swift back-deployment libraries
5050
# * compiler -- the Swift compiler and (on supported platforms) the REPL.
51+
# * compiler-swift-syntax-lib -- install swift-syntax libraries for the compiler.
5152
# * clang-builtin-headers -- install a copy of Clang builtin headers under
5253
# 'lib/swift/clang'. This is useful when Swift compiler is installed in
5354
# isolation.
@@ -70,7 +71,7 @@
7071
# * llvm-toolchain-dev-tools -- install LLVM development tools useful in a shared toolchain
7172
# * dev -- headers and libraries required to use Swift compiler as a library.
7273
set(_SWIFT_DEFINED_COMPONENTS
73-
"autolink-driver;back-deployment;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;libexec;stdlib;stdlib-experimental;sdk-overlay;static-mirror-lib;swift-syntax-lib;editor-integration;tools;testsuite-tools;toolchain-tools;toolchain-dev-tools;llvm-toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
74+
"autolink-driver;back-deployment;compiler;compiler-swift-syntax;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;libexec;stdlib;stdlib-experimental;sdk-overlay;static-mirror-lib;swift-syntax-lib;editor-integration;tools;testsuite-tools;toolchain-tools;toolchain-dev-tools;llvm-toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
7475

7576
# The default install components include all of the defined components, except
7677
# for the following exceptions.
@@ -97,10 +98,10 @@ macro(swift_configure_components)
9798
set(SWIFT_INSTALL_COMPONENTS "${_SWIFT_DEFAULT_COMPONENTS}" CACHE STRING
9899
"A semicolon-separated list of components to install from the set ${_SWIFT_DEFINED_COMPONENTS}")
99100

100-
# 'compiler' depends on 'swift-syntax-lib' component.
101+
# 'compiler' depends on 'compiler-swift-syntax-lib' component.
101102
if ("compiler" IN_LIST SWIFT_INSTALL_COMPONENTS AND
102-
NOT "swift-syntax-lib" IN_LIST SWIFT_INSTALL_COMPONENTS)
103-
list(APPEND SWIFT_INSTALL_COMPONENTS "swift-syntax-lib")
103+
NOT "compiler-swift-syntax-lib" IN_LIST SWIFT_INSTALL_COMPONENTS)
104+
list(APPEND SWIFT_INSTALL_COMPONENTS "compiler-swift-syntax-lib")
104105
endif()
105106

106107
foreach(component ${_SWIFT_DEFINED_COMPONENTS})

lib/CompilerSwiftSyntax/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ foreach(lib ${compiler_swiftsyntax_libs})
5252
endforeach()
5353

5454
swift_install_in_component(TARGETS ${compiler_swiftsyntax_libs}
55-
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler
56-
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler
57-
RUNTIME DESTINATION "bin" COMPONENT compiler)
55+
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler-swift-syntax-lib
56+
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler-swift-syntax-lib
57+
RUNTIME DESTINATION "bin" COMPONENT compiler-swift-syntax-lib)

0 commit comments

Comments
 (0)