Skip to content

Commit b12629b

Browse files
committed
Export CMake targets for use by SwiftPM
1 parent 7319148 commit b12629b

File tree

27 files changed

+247
-12
lines changed

27 files changed

+247
-12
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)

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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,26 @@ 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
1313
CLibRemarksHelper.c)
1414
target_compile_definitions(SWBCSupport PRIVATE
1515
$<$<PLATFORM_ID:Windows>:_CRT_SECURE_NO_WARNINGS>
1616
$<$<PLATFORM_ID:Windows>:_CRT_NONSTDC_NO_WARNINGS>)
1717
target_compile_options(SWBCSupport PRIVATE
1818
-fblocks)
19+
target_link_options(SWBCSupport PUBLIC
20+
$<$<PLATFORM_ID:Darwin>:-lc++>)
1921
target_include_directories(SWBCSupport PUBLIC
2022
${CMAKE_CURRENT_SOURCE_DIR})
2123
# TODO(compnerd) wire this up with `find_package`
2224
target_link_libraries(SWBCSupport PRIVATE
2325
$<$<NOT:$<PLATFORM_ID:Darwin>>:BlocksRuntime>)
26+
27+
target_include_directories(SWBCSupport PUBLIC
28+
${CMAKE_CURRENT_BINARY_DIR})
29+
30+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCSupport)
31+
32+
install(TARGETS SWBCSupport
33+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

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
@@ -42,3 +42,11 @@ target_link_libraries(SWBUniversalPlatform PUBLIC
4242
SWBUtil)
4343
target_sources(SWBUniversalPlatform PRIVATE
4444
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
45+
46+
set_target_properties(SWBUniversalPlatform PROPERTIES
47+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
48+
49+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBUniversalPlatform)
50+
51+
install(TARGETS SWBUniversalPlatform
52+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBUtil/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,11 @@ target_link_libraries(SWBUtil PUBLIC
109109
SWBLibc
110110
ArgumentParser
111111
$<$<NOT:$<PLATFORM_ID:Darwin>>:SwiftSystem::SystemPackage>)
112+
113+
set_target_properties(SWBUtil PROPERTIES
114+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
115+
116+
set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBUtil)
117+
118+
install(TARGETS SWBUtil
119+
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

Sources/SWBWebAssemblyPlatform/CMakeLists.txt

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

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

0 commit comments

Comments
 (0)