mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
[CMake] Stop some exectuable link with swiftCore
swift-compatibility-symbols, swift-def-to-strings-converter, and swift-serialize-diagnostics don't use any Swift modules. But when SWIFT_SWIFT_PARSER was enabled, they are linked with swiftCore. But these binaries can be executed before the runtime is being built. We need to stop them linking with swiftCore.
This commit is contained in:
@@ -833,7 +833,7 @@ endmacro()
|
||||
#
|
||||
# Usage:
|
||||
# add_swift_host_tool(name
|
||||
# [HAS_SWIFT_MODULES]
|
||||
# [HAS_SWIFT_MODULES | DOES_NOT_USE_SWIFT]
|
||||
# [THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY]
|
||||
#
|
||||
# [BOOTSTRAPPING 0|1]
|
||||
@@ -847,6 +847,9 @@ endmacro()
|
||||
# HAS_SWIFT_MODULES
|
||||
# Whether to link with SwiftCompilerSources library
|
||||
#
|
||||
# DOES_NOT_USE_SWIFT
|
||||
# Do not link with swift runtime
|
||||
#
|
||||
# THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY
|
||||
# Opt-out of LLVM IR optimizations when linking ThinLTO with ld64
|
||||
#
|
||||
@@ -862,7 +865,7 @@ endmacro()
|
||||
# source1 ...
|
||||
# Sources to add into this executable.
|
||||
function(add_swift_host_tool executable)
|
||||
set(options HAS_SWIFT_MODULES THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)
|
||||
set(options HAS_SWIFT_MODULES DOES_NOT_USE_SWIFT THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)
|
||||
set(single_parameter_options SWIFT_COMPONENT BOOTSTRAPPING)
|
||||
set(multiple_parameter_options LLVM_LINK_COMPONENTS)
|
||||
|
||||
@@ -918,7 +921,7 @@ function(add_swift_host_tool executable)
|
||||
endif()
|
||||
|
||||
# Once the new Swift parser is linked in, every host tool has Swift modules.
|
||||
if (SWIFT_SWIFT_PARSER)
|
||||
if (SWIFT_SWIFT_PARSER AND NOT ASHT_DOES_NOT_USE_SWIFT)
|
||||
set(ASHT_HAS_SWIFT_MODULES ON)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ add_swift_host_tool(swift-compatibility-symbols
|
||||
swift-compatibility-symbols.cpp
|
||||
LLVM_LINK_COMPONENTS support
|
||||
SWIFT_COMPONENT tools
|
||||
DOES_NOT_USE_SWIFT
|
||||
)
|
||||
|
||||
set(syms_file "${CMAKE_BINARY_DIR}/share/swift/compatibility-symbols")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
add_swift_host_tool(swift-def-to-strings-converter
|
||||
swift-def-to-strings-converter.cpp
|
||||
SWIFT_COMPONENT tools
|
||||
DOES_NOT_USE_SWIFT
|
||||
)
|
||||
|
||||
target_link_libraries(swift-def-to-strings-converter PRIVATE
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
add_swift_host_tool(swift-serialize-diagnostics
|
||||
swift-serialize-diagnostics.cpp
|
||||
SWIFT_COMPONENT tools
|
||||
DOES_NOT_USE_SWIFT
|
||||
)
|
||||
target_link_libraries(swift-serialize-diagnostics PRIVATE
|
||||
swiftLocalization)
|
||||
|
||||
Reference in New Issue
Block a user