Skip to content

Commit 3f17bb6

Browse files
committed
Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I purposely did not debride anything. This is to ensure that I am not touching too much and increasing the probability of weird errors from occurring. Thus the exact same code should be executed... just the routing changed.
1 parent 1982d02 commit 3f17bb6

File tree

92 files changed

+811
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+811
-104
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 710 additions & 3 deletions
Large diffs are not rendered by default.

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
8686
# then applied to all targets. This causes issues in cross-compiling to
8787
# Windows from a Linux host.
8888
#
89-
# To work around this, we unconditionally remove the flag here and then
90-
# selectively add it to the per-target link flags; this is currently done
91-
# in add_swift_library within AddSwift.cmake.
89+
# To work around this, we unconditionally remove the flag here and then
90+
# selectively add it to the per-target link flags; this is currently done in
91+
# add_swift_host_library and add_swift_target_library within AddSwift.cmake.
9292
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
9393
string(REGEX REPLACE "-Wl,-z,nodelete" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
9494

lib/AST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if (SWIFT_FORCE_OPTIMIZED_TYPECHECKER)
33
set(EXTRA_AST_FLAGS "FORCE_BUILD_OPTIMIZED")
44
endif()
55

6-
add_swift_library(swiftAST STATIC
6+
add_swift_host_library(swiftAST STATIC
77
AccessScopeChecker.cpp
88
AccessRequests.cpp
99
ASTContext.cpp

lib/ASTSectionImporter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftASTSectionImporter STATIC
1+
add_swift_host_library(swiftASTSectionImporter STATIC
22
ASTSectionImporter.cpp
33
LINK_LIBRARIES swiftBasic
44
LLVM_COMPONENT_DEPENDS core)

lib/Basic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}")
6464
set(version_inc_files
6565
${llvm_revision_inc} ${clang_revision_inc} ${swift_revision_inc})
6666

67-
add_swift_library(swiftBasic STATIC
67+
add_swift_host_library(swiftBasic STATIC
6868
AnyValue.cpp
6969
Cache.cpp
7070
ClusteredBitVector.cpp

lib/ClangImporter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(SWIFT_GYB_FLAGS
44
add_gyb_target(generated_sorted_cf_database
55
SortedCFDatabase.def.gyb)
66

7-
add_swift_library(swiftClangImporter STATIC
7+
add_swift_host_library(swiftClangImporter STATIC
88
CFTypeInfo.cpp
99
ClangAdapter.cpp
1010
ClangDiagnosticConsumer.cpp

lib/Demangling/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftDemangling
1+
add_swift_host_library(swiftDemangling
22
STATIC
33
Demangler.cpp
44
Context.cpp

lib/Driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(swiftDriver_sources
1616

1717
set(swiftDriver_targetDefines)
1818

19-
add_swift_library(swiftDriver STATIC
19+
add_swift_host_library(swiftDriver STATIC
2020
${swiftDriver_sources}
2121
DEPENDS SwiftOptions
2222
LINK_LIBRARIES swiftAST swiftBasic swiftOption)

lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftFrontend STATIC
1+
add_swift_host_library(swiftFrontend STATIC
22
ArgsToFrontendInputsConverter.cpp
33
ArgsToFrontendOptionsConverter.cpp
44
ArgsToFrontendOutputsConverter.cpp

lib/FrontendTool/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_swift_library(swiftFrontendTool STATIC
1+
add_swift_host_library(swiftFrontendTool STATIC
22
FrontendTool.cpp
33
ImportedModules.cpp
44
ReferenceDependencies.cpp

0 commit comments

Comments
 (0)