Skip to content

Commit d457d6a

Browse files
committed
build: add dependencies via DEPENDS
Use the `DEPENDS` keyword argument to `add_swift_*` instead of the explicit `add_dependencies`.
1 parent 4991c51 commit d457d6a

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,9 @@ add_swift_library(Foundation
259259
-I;${ICU_INCLUDE_DIR}
260260
${libdispatch_cflags}
261261
${swift_enable_testing}
262-
${swift_optimization_flags})
263-
add_dependencies(Foundation CoreFoundation)
262+
${swift_optimization_flags}
263+
DEPENDS
264+
CoreFoundation)
264265

265266
add_swift_executable(plutil
266267
SOURCES
@@ -280,8 +281,10 @@ add_swift_executable(plutil
280281
-I;${ICU_INCLUDE_DIR}
281282
${libdispatch_cflags}
282283
${swift_enable_testing}
283-
${swift_optimization_flags})
284-
add_dependencies(plutil Foundation CoreFoundation)
284+
${swift_optimization_flags}
285+
DEPENDS
286+
Foundation
287+
CoreFoundation)
285288

286289
if(ENABLE_TESTING)
287290
add_swift_executable(xdgTestHelper
@@ -298,8 +301,10 @@ if(ENABLE_TESTING)
298301
SWIFT_FLAGS
299302
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
300303
-I;${ICU_INCLUDE_DIR}
301-
${libdispatch_cflags})
302-
add_dependencies(xdgTestHelper Foundation CoreFoundation)
304+
${libdispatch_cflags}
305+
DEPENDS
306+
Foundation
307+
CoreFoundation)
303308

304309
add_swift_executable(TestFoundation
305310
SOURCES
@@ -429,8 +434,11 @@ if(ENABLE_TESTING)
429434
-I;${FOUNDATION_PATH_TO_XCTEST_BUILD}/swift
430435
-I;${ICU_INCLUDE_DIR}
431436
${libdispatch_cflags}
432-
${swift_optimization_flags})
433-
add_dependencies(TestFoundation Foundation CoreFoundation xdgTestHelper)
437+
${swift_optimization_flags}
438+
DEPENDS
439+
Foundation
440+
CoreFoundation
441+
xdgTestHelper)
434442

435443
add_custom_command(TARGET TestFoundation
436444
POST_BUILD

0 commit comments

Comments
 (0)