Skip to content

Commit 31a5ae7

Browse files
committed
build: remove LINK_INTERFACE_LIBRARIES from add_swift_host_library
Use the appropriate CMake mechanism for building the libraries.
1 parent b0005e9 commit 31a5ae7

File tree

4 files changed

+30
-37
lines changed

4 files changed

+30
-37
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,6 @@ endfunction()
13541354
# [SHARED]
13551355
# [STATIC]
13561356
# [DEPENDS dep1 ...]
1357-
# [INTERFACE_LINK_LIBRARIES dep1 ...]
13581357
# [SWIFT_MODULE_DEPENDS dep1 ...]
13591358
# [LLVM_COMPONENT_DEPENDS comp1 ...]
13601359
# [FILE_DEPENDS target1 ...]
@@ -1414,6 +1413,9 @@ function(add_swift_host_library name)
14141413
if(ASHL_C_COMPILE_FLAGS)
14151414
message(SEND_ERROR "library ${name} is using C_COMPILE_FLAGS parameter which is deprecated. Please use target_compile_definitions, target_compile_options, or target_include_directories instead")
14161415
endif()
1416+
if(ASHL_INTERFACE_LINK_LIBRARIES)
1417+
message(SEND_ERROR "library ${name} is using INTERFACE_LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead.")
1418+
endif()
14171419
if(ASHL_LINK_LIBRARIES)
14181420
message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
14191421
endif()
@@ -1437,7 +1439,6 @@ function(add_swift_host_library name)
14371439
LLVM_COMPONENT_DEPENDS ${ASHL_LLVM_COMPONENT_DEPENDS}
14381440
FILE_DEPENDS ${ASHL_FILE_DEPENDS}
14391441
LINK_FLAGS ${ASHL_LINK_FLAGS}
1440-
INTERFACE_LINK_LIBRARIES ${ASHL_INTERFACE_LINK_LIBRARIES}
14411442
INSTALL_IN_COMPONENT "dev"
14421443
)
14431444

lib/AST/CMakeLists.txt

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,8 @@ if (SWIFT_FORCE_OPTIMIZED_TYPECHECKER)
44
endif()
55

66
if(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB)
7-
set(SWIFTAST_INTERFACE_LINK_LIBRARIES)
87
set(SWIFTAST_LLVM_COMPONENT_DEPENDS)
98
else()
10-
set(SWIFTAST_INTERFACE_LINK_LIBRARIES
11-
# Clang dependencies.
12-
# FIXME: Clang should really export these in some reasonable manner.
13-
clangCodeGen
14-
clangIndex
15-
clangFormat
16-
clangToolingCore
17-
clangFrontendTool
18-
clangFrontend
19-
clangDriver
20-
clangSerialization
21-
clangParse
22-
clangSema
23-
clangAnalysis
24-
clangEdit
25-
clangRewriteFrontend
26-
clangRewrite
27-
clangAST
28-
clangLex
29-
clangAPINotes
30-
clangBasic
31-
)
329
set(SWIFTAST_LLVM_COMPONENT_DEPENDS
3310
bitreader bitwriter coroutines coverage irreader debuginfoDWARF
3411
profiledata instrumentation object objcarcopts mc mcparser
@@ -98,14 +75,32 @@ add_swift_host_library(swiftAST STATIC
9875
UnqualifiedLookup.cpp
9976
USRGeneration.cpp
10077

101-
INTERFACE_LINK_LIBRARIES
102-
${SWIFTAST_INTERFACE_LINK_LIBRARIES}
103-
10478
LLVM_COMPONENT_DEPENDS
10579
${SWIFTAST_LLVM_COMPONENT_DEPENDS}
10680

10781
${EXTRA_AST_FLAGS}
10882
)
83+
if(NOT SWIFT_BUILD_ONLY_SYNTAXPARSERLIB)
84+
target_link_libraries(swiftAST INTERFACE
85+
clangCodeGen
86+
clangIndex
87+
clangFormat
88+
clangToolingCore
89+
clangFrontendTool
90+
clangFrontend
91+
clangDriver
92+
clangSerialization
93+
clangParse
94+
clangSema
95+
clangAnalysis
96+
clangEdit
97+
clangRewriteFrontend
98+
clangRewrite
99+
clangAST
100+
clangLex
101+
clangAPINotes
102+
clangBasic)
103+
endif()
109104

110105
if(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB)
111106
# Add clangBasic as a single direct dependency to avoid bringing along some

lib/FrontendTool/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ add_swift_host_library(swiftFrontendTool STATIC
55
TBD.cpp
66
DEPENDS
77
swift-syntax-generated-headers SwiftOptions
8-
INTERFACE_LINK_LIBRARIES
9-
clangAPINotes
10-
clangBasic
118
)
9+
target_link_libraries(swiftFrontendTool INTERFACE
10+
clangAPINotes
11+
clangBasic)
1212
target_link_libraries(swiftFrontendTool PRIVATE
1313
swiftClangImporter
1414
swiftDemangling

lib/IRGen/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,13 @@ add_swift_host_library(swiftIRGen STATIC
5151
TypeLayoutDumper.cpp
5252
TypeLayoutVerifier.cpp
5353

54-
INTERFACE_LINK_LIBRARIES
55-
# Clang dependencies.
56-
# FIXME: Clang should really export these in some reasonable manner.
57-
clangCodeGen
58-
clangAST
59-
6054
LLVM_COMPONENT_DEPENDS
6155
target
6256
transformutils
6357
)
58+
target_link_libraries(swiftIRGen INTERFACE
59+
clangCodeGen
60+
clangAST)
6461
target_link_libraries(swiftIRGen PRIVATE
6562
swiftAST
6663
swiftLLVMPasses

0 commit comments

Comments
 (0)