Skip to content

Commit 6009dcb

Browse files
committed
build: improve _InternalSwiftSyntaxParser installation
Use the `TARGETS` form of `install` to avoid having to spell out the location and file name to install. Additionally, setup the installation rules to work better for Windows by listing install locations for the archive (static library) form (which includes the import library on Windows), library form (which is the Unix library), and the runtime component (the .dll on Windows).
1 parent 949b0c0 commit 6009dcb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/libSwiftSyntaxParser/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
5151
endif()
5252

5353
add_dependencies(parser-lib libSwiftSyntaxParser)
54-
swift_install_in_component(PROGRAMS "${SWIFT_LIBRARY_OUTPUT_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${SYNTAX_PARSER_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
55-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}"
56-
COMPONENT parser-lib)
54+
swift_install_in_component(TARGETS libSwiftSyntaxParser
55+
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT parser-lib
56+
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT parser-lib
57+
RUNTIME DESTINATION "bin" COMPONENT parser-lib)
5758
swift_install_in_component(DIRECTORY "${SWIFT_MAIN_INCLUDE_DIR}/swift-c/SyntaxParser/"
5859
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SYNTAX_PARSER_LIB_NAME}"
5960
COMPONENT parser-lib)

0 commit comments

Comments
 (0)