Skip to content

Commit 925c4a7

Browse files
committed
Export CMake targets for use by SwiftPM
1 parent 377eb6f commit 925c4a7

File tree

29 files changed

+273
-14
lines changed

29 files changed

+273
-14
lines changed

CMakeLists.txt

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ cmake_minimum_required(VERSION 3.26...3.29)
1212
project(SwiftBuild
1313
LANGUAGES C CXX Swift)
1414

15+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
16+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
17+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
18+
19+
set(CMAKE_INSTALL_RPATH "$<IF:$<PLATFORM_ID:Darwin>,@loader_path/..,$ORIGIN>")
20+
set(CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH YES)
21+
22+
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
23+
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
24+
25+
option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)
26+
1527
set(CMAKE_C_VISIBILITY hidden)
1628
set(CMAKE_CXX_VISIBILITY hidden)
1729
set(CMAKE_CXX_STANDARD 17)
@@ -35,7 +47,33 @@ add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SwiftBuild>
3547
# rdar://137809703
3648
# "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature RegionBasedIsolation>"
3749
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature ExistentialAny>"
38-
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault>")
50+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault>"
51+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-no-toolchain-stdlib-rpath>"
52+
# Turn off autolinking within this project to reduce linker overhead.
53+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBLibc>"
54+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBAndroidPlatform>"
55+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBApplePlatform>"
56+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBBuildService>"
57+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCLibc>"
58+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBGenericUnixPlatform>"
59+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBTaskConstruction>"
60+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBUtil>"
61+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBUniversalPlatform>"
62+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBWindowsPlatform>"
63+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SwiftBuild>"
64+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBWebAssemblyPlatform>"
65+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCSupport>"
66+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBMacro>"
67+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBProjectModel>"
68+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBTaskExecution>"
69+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBServiceCore>"
70+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBQNXPlatform>"
71+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBProtocol>"
72+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBLLBuild>"
73+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCore>"
74+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCAS>"
75+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBBuildSystem>"
76+
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCore>")
3977

4078
# Prefer the static initialization for the plugins.
4179
add_compile_definitions(USE_STATIC_PLUGIN_INITIALIZATION)
@@ -50,3 +88,4 @@ find_package(Threads)
5088
find_package(SQLite3)
5189

5290
add_subdirectory(Sources)
91+
add_subdirectory(cmake/modules)

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ let package = Package(
135135
swiftSettings: swiftSettings(languageMode: .v5)),
136136
.target(
137137
name: "SWBCSupport",
138+
exclude: ["empty.swift"],
138139
publicHeadersPath: ".",
139140
cSettings: [
140141
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])),

Sources/SWBAndroidPlatform/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ file(CONFIGURE
2828
]]
2929
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
3030

31-
add_library(SWBAndroidPlatform STATIC
31+
add_library(SWBAndroidPlatform
3232
AndroidSDK.swift
3333
Plugin.swift)
3434
target_link_libraries(SWBAndroidPlatform PUBLIC
@@ -37,3 +37,11 @@ target_link_libraries(SWBAndroidPlatform PUBLIC
3737
SWBUtil)
3838
target_sources(SWBAndroidPlatform PRIVATE
3939
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
40+
41+
set_target_properties(SWBAndroidPlatform PROPERTIES
42+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
43+
44+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBAndroidPlatform)
45+
46+
install(TARGETS SWBAndroidPlatform
47+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBApplePlatform/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ file(CONFIGURE
2828
]]
2929
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
3030

31-
add_library(SWBApplePlatform STATIC
31+
add_library(SWBApplePlatform
3232
AppIntentsMetadataCompiler.swift
3333
AppIntentsMetadataTaskProducer.swift
3434
AppIntentsSSUTrainingCompiler.swift
@@ -75,3 +75,11 @@ target_link_libraries(SWBApplePlatform PUBLIC
7575
SWBTaskConstruction)
7676
target_sources(SWBApplePlatform PRIVATE
7777
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
78+
79+
set_target_properties(SWBApplePlatform PROPERTIES
80+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
81+
82+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBApplePlatform)
83+
84+
install(TARGETS SWBApplePlatform
85+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBBuildService/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ target_link_libraries(SWBBuildService PUBLIC
3737
SWBWebAssemblyPlatform
3838
SWBWindowsPlatform
3939
$<$<NOT:$<PLATFORM_ID:Darwin>>:SwiftSystem::SystemPackage>)
40+
41+
set_target_properties(SWBBuildService PROPERTIES
42+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
43+
44+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildService)
45+
46+
install(TARGETS SWBBuildService
47+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBBuildServiceBundle/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ target_link_libraries(SWBBuildServiceBundle PRIVATE
2020
SWBCore)
2121

2222
install(TARGETS SWBBuildServiceBundle)
23+
24+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildServiceBundle)

Sources/SWBBuildSystem/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ target_link_libraries(SWBBuildSystem PUBLIC
2222
SWBCore
2323
SWBTaskConstruction
2424
SWBTaskExecution)
25+
26+
set_target_properties(SWBBuildSystem PROPERTIES
27+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
28+
29+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildSystem)
30+
31+
install(TARGETS SWBBuildSystem
32+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBCAS/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ set_target_properties(SWBCAS PROPERTIES
1919
target_link_libraries(SWBCAS PUBLIC
2020
SWBUtil
2121
SWBCSupport)
22+
23+
set_target_properties(SWBCAS PROPERTIES
24+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
25+
26+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCAS)
27+
28+
install(TARGETS SWBCAS
29+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBCLibc/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ add_library(SWBCLibc
1212
libc.c)
1313
target_include_directories(SWBCLibc INTERFACE
1414
include)
15+
16+
target_include_directories(SWBCLibc PUBLIC
17+
${CMAKE_CURRENT_BINARY_DIR})
18+
19+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCLibc)
20+
21+
install(TARGETS SWBCLibc
22+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBCSupport/CMakeLists.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,33 @@ See http://swift.org/LICENSE.txt for license information
88
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99
]]
1010

11-
add_library(SWBCSupport STATIC
11+
add_library(SWBCSupport
1212
CLibclang.cpp
13-
CLibRemarksHelper.c)
13+
CLibRemarksHelper.c
14+
empty.swift)
15+
# Use swiftc as the linker so we pick up search paths for the blocks runtime,
16+
# and enable C++ interop so it delegates to clang++.
17+
set_target_properties(SWBCSupport PROPERTIES
18+
LINKER_LANGUAGE Swift)
19+
set_target_properties(SWBCSupport PROPERTIES
20+
Swift_MODULE_NAME __SWBCSupport_Empty)
21+
target_link_options(SWBCSupport PRIVATE
22+
-cxx-interoperability-mode=default)
1423
target_compile_definitions(SWBCSupport PRIVATE
1524
$<$<PLATFORM_ID:Windows>:_CRT_SECURE_NO_WARNINGS>
1625
$<$<PLATFORM_ID:Windows>:_CRT_NONSTDC_NO_WARNINGS>)
1726
target_compile_options(SWBCSupport PRIVATE
18-
-fblocks)
27+
"$<$<COMPILE_LANGUAGE:CXX>:SHELL:-fblocks>")
1928
target_include_directories(SWBCSupport PUBLIC
2029
${CMAKE_CURRENT_SOURCE_DIR})
2130
# TODO(compnerd) wire this up with `find_package`
2231
target_link_libraries(SWBCSupport PRIVATE
2332
$<$<NOT:$<PLATFORM_ID:Darwin>>:BlocksRuntime>)
33+
34+
#target_include_directories(SWBCSupport PUBLIC
35+
# ${CMAKE_CURRENT_BINARY_DIR})
36+
37+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCSupport)
38+
39+
install(TARGETS SWBCSupport
40+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBCSupport/empty.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift open source project
4+
//
5+
// Copyright (c) 2025 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
// This file is intentionally left blank. When built with CMake,
14+
// SWBCSupport sets the link language to Swift w/ C++ interop
15+
// to find libblocksruntime, and requires at least one Swift
16+
// source file to avoid downstream issues.

Sources/SWBCore/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,11 @@ target_link_libraries(SWBCore PUBLIC
207207
SwiftDriver)
208208
target_sources(SWBCore PRIVATE
209209
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
210+
211+
set_target_properties(SWBCore PROPERTIES
212+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
213+
214+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCore)
215+
216+
install(TARGETS SWBCore
217+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBGenericUnixPlatform/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,18 @@ file(CONFIGURE
2828
]]
2929
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
3030

31-
add_library(SWBGenericUnixPlatform STATIC
31+
add_library(SWBGenericUnixPlatform
3232
Plugin.swift)
3333
target_link_libraries(SWBGenericUnixPlatform PUBLIC
3434
SWBCore
3535
SWBUtil)
3636
target_sources(SWBGenericUnixPlatform PRIVATE
3737
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
38+
39+
set_target_properties(SWBGenericUnixPlatform PROPERTIES
40+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
41+
42+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBGenericUnixPlatform)
43+
44+
install(TARGETS SWBGenericUnixPlatform
45+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBLLBuild/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ set_target_properties(SWBLLBuild PROPERTIES
1414
Swift_LANGUAGE_VERSION 6)
1515
target_link_libraries(SWBLLBuild PUBLIC
1616
SWBUtil
17-
$<$<NOT:$<BOOL:${SwiftBuild_USE_LLBUILD_FRAMEWORK}>>:libllbuild>
1817
$<$<NOT:$<BOOL:${SwiftBuild_USE_LLBUILD_FRAMEWORK}>>:llbuildSwift>)
18+
19+
set_target_properties(SWBLLBuild PROPERTIES
20+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
21+
22+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBLLBuild)
23+
24+
install(TARGETS SWBLLBuild
25+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBLibc/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ target_link_libraries(SWBLibc PUBLIC
1919
# without this explicit configuration.
2020
target_include_directories(SWBLibc PUBLIC
2121
${CMAKE_CURRENT_BINARY_DIR})
22+
23+
set_target_properties(SWBLibc PROPERTIES
24+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
25+
26+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBLibc)
27+
28+
install(TARGETS SWBLibc
29+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBMacro/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@ target_link_libraries(SWBMacro PUBLIC
3131
SwiftDriver
3232
TSCBasic)
3333

34-
target_include_directories(SWBMacro PUBLIC
35-
${CMAKE_CURRENT_BINARY_DIR})
34+
set_target_properties(SWBMacro PROPERTIES
35+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
36+
37+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBMacro)
38+
39+
install(TARGETS SWBMacro
40+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBProjectModel/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ set_target_properties(SWBProjectModel PROPERTIES
2020
Swift_LANGUAGE_VERSION 6)
2121
target_link_libraries(SWBProjectModel PUBLIC
2222
SWBProtocol)
23+
24+
set_target_properties(SWBProjectModel PROPERTIES
25+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
26+
27+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBProjectModel)
28+
29+
install(TARGETS SWBProjectModel
30+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBProtocol/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ set_target_properties(SWBProtocol PROPERTIES
4848
Swift_LANGUAGE_VERSION 6)
4949
target_link_libraries(SWBProtocol PUBLIC
5050
SWBUtil)
51+
52+
set_target_properties(SWBProtocol PROPERTIES
53+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
54+
55+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBProtocol)
56+
57+
install(TARGETS SWBProtocol
58+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBQNXPlatform/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ file(CONFIGURE
2828
]]
2929
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
3030

31-
add_library(SWBQNXPlatform STATIC
31+
add_library(SWBQNXPlatform
3232
Plugin.swift
3333
QNXSDP.swift)
3434
target_link_libraries(SWBQNXPlatform PUBLIC
@@ -37,3 +37,11 @@ target_link_libraries(SWBQNXPlatform PUBLIC
3737
SWBUtil)
3838
target_sources(SWBQNXPlatform PRIVATE
3939
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
40+
41+
set_target_properties(SWBQNXPlatform PROPERTIES
42+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
43+
44+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBQNXPlatform)
45+
46+
install(TARGETS SWBQNXPlatform
47+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBServiceCore/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ set_target_properties(SWBServiceCore PROPERTIES
1818
Swift_LANGUAGE_VERSION 6)
1919
target_link_libraries(SWBServiceCore PUBLIC
2020
SWBProtocol)
21+
22+
set_target_properties(SWBServiceCore PROPERTIES
23+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
24+
25+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBServiceCore)
26+
27+
install(TARGETS SWBServiceCore
28+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBTaskConstruction/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,11 @@ set_target_properties(SWBTaskConstruction PROPERTIES
6363
target_link_libraries(SWBTaskConstruction PUBLIC
6464
SWBCore
6565
SWBUtil)
66+
67+
set_target_properties(SWBTaskConstruction PROPERTIES
68+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
69+
70+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBTaskConstruction)
71+
72+
install(TARGETS SWBTaskConstruction
73+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBTaskExecution/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,11 @@ target_link_libraries(SWBTaskExecution PUBLIC
8282
SWBLLBuild
8383
SWBTaskConstruction
8484
SWBUtil)
85+
86+
set_target_properties(SWBTaskExecution PROPERTIES
87+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
88+
89+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBTaskExecution)
90+
91+
install(TARGETS SWBTaskExecution
92+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBUniversalPlatform/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ file(CONFIGURE
2828
]]
2929
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
3030

31-
add_library(SWBUniversalPlatform STATIC
31+
add_library(SWBUniversalPlatform
3232
CopyPlistFile.swift
3333
CopyStringsFile.swift
3434
CppTool.swift
@@ -48,3 +48,11 @@ target_link_libraries(SWBUniversalPlatform PUBLIC
4848
ArgumentParser)
4949
target_sources(SWBUniversalPlatform PRIVATE
5050
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
51+
52+
set_target_properties(SWBUniversalPlatform PROPERTIES
53+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
54+
55+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBUniversalPlatform)
56+
57+
install(TARGETS SWBUniversalPlatform
58+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

0 commit comments

Comments
 (0)