Skip to content

Commit 68ae32f

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 68ae32f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

CMakeLists.txt

Lines changed: 14 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,9 @@ 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+
CoreFoundation)
285287

286288
if(ENABLE_TESTING)
287289
add_swift_executable(xdgTestHelper
@@ -298,8 +300,9 @@ if(ENABLE_TESTING)
298300
SWIFT_FLAGS
299301
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
300302
-I;${ICU_INCLUDE_DIR}
301-
${libdispatch_cflags})
302-
add_dependencies(xdgTestHelper Foundation CoreFoundation)
303+
${libdispatch_cflags}
304+
DEPENDS
305+
CoreFoundation)
303306

304307
add_swift_executable(TestFoundation
305308
SOURCES
@@ -429,8 +432,11 @@ if(ENABLE_TESTING)
429432
-I;${FOUNDATION_PATH_TO_XCTEST_BUILD}/swift
430433
-I;${ICU_INCLUDE_DIR}
431434
${libdispatch_cflags}
432-
${swift_optimization_flags})
433-
add_dependencies(TestFoundation Foundation CoreFoundation xdgTestHelper)
435+
${swift_optimization_flags}
436+
DEPENDS
437+
Foundation
438+
CoreFoundation
439+
xdgTestHelper)
434440

435441
add_custom_command(TARGET TestFoundation
436442
POST_BUILD

0 commit comments

Comments
 (0)