Skip to content

Commit f9df4ca

Browse files
committed
build: remove DEPENDS from add_swift_host_library
Use the appropriate CMake mechanisms for building the libraries.
1 parent c1c75a4 commit f9df4ca

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,6 @@ endfunction()
13531353
# add_swift_host_library(name
13541354
# [SHARED]
13551355
# [STATIC]
1356-
# [DEPENDS dep1 ...]
13571356
# [SWIFT_MODULE_DEPENDS dep1 ...]
13581357
# [LLVM_COMPONENT_DEPENDS comp1 ...]
13591358
# [FILE_DEPENDS target1 ...]
@@ -1370,9 +1369,6 @@ endfunction()
13701369
# STATIC
13711370
# Build a static library.
13721371
#
1373-
# DEPENDS
1374-
# Targets that this library depends on.
1375-
#
13761372
# LLVM_COMPONENT_DEPENDS
13771373
# LLVM components this library depends on.
13781374
#
@@ -1408,6 +1404,9 @@ function(add_swift_host_library name)
14081404
if(ASHL_C_COMPILE_FLAGS)
14091405
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")
14101406
endif()
1407+
if(ASHL_DEPENDS)
1408+
message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated. Please use add_dependencies instead")
1409+
endif()
14111410
if(ASHL_INTERFACE_LINK_LIBRARIES)
14121411
message(SEND_ERROR "library ${name} is using INTERFACE_LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead.")
14131412
endif()
@@ -1430,7 +1429,6 @@ function(add_swift_host_library name)
14301429
${ASHL_FORCE_BUILD_OPTIMIZED_keyword}
14311430
SDK ${SWIFT_HOST_VARIANT_SDK}
14321431
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
1433-
DEPENDS ${ASHL_DEPENDS}
14341432
LLVM_COMPONENT_DEPENDS ${ASHL_LLVM_COMPONENT_DEPENDS}
14351433
FILE_DEPENDS ${ASHL_FILE_DEPENDS}
14361434
INSTALL_IN_COMPONENT "dev"

lib/Driver/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ set(swiftDriver_sources
1818
set(swiftDriver_targetDefines)
1919

2020
add_swift_host_library(swiftDriver STATIC
21-
${swiftDriver_sources}
22-
DEPENDS SwiftOptions)
21+
${swiftDriver_sources})
22+
add_dependencies(swiftDriver
23+
SwiftOptions)
2324
target_link_libraries(swiftDriver PRIVATE
2425
swiftAST
2526
swiftBasic

lib/Frontend/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ add_swift_host_library(swiftFrontend STATIC
99
FrontendOptions.cpp
1010
ParseableInterfaceSupport.cpp
1111
PrintingDiagnosticConsumer.cpp
12-
SerializedDiagnosticConsumer.cpp
13-
DEPENDS
14-
SwiftOptions)
12+
SerializedDiagnosticConsumer.cpp)
13+
add_dependencies(swiftFrontend
14+
SwiftOptions)
1515
target_link_libraries(swiftFrontend PRIVATE
1616
swiftSIL
1717
swiftMigrator

lib/FrontendTool/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ add_swift_host_library(swiftFrontendTool STATIC
22
FrontendTool.cpp
33
ImportedModules.cpp
44
ReferenceDependencies.cpp
5-
TBD.cpp
6-
DEPENDS
7-
swift-syntax-generated-headers SwiftOptions
8-
)
5+
TBD.cpp)
6+
add_dependencies(swiftFrontendTool
7+
swift-syntax-generated-headers
8+
SwiftOptions)
99
target_link_libraries(swiftFrontendTool INTERFACE
1010
clangAPINotes
1111
clangBasic)

lib/Option/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
add_swift_host_library(swiftOption STATIC
22
Options.cpp
33
SanitizerOptions.cpp
4-
DEPENDS SwiftOptions
54
FILE_DEPENDS SwiftOptions)
5+
add_dependencies(swiftOption
6+
SwiftOptions)
67
target_link_libraries(swiftOption PRIVATE
78
swiftBasic)
89

0 commit comments

Comments
 (0)