Skip to content

Commit 75aed2c

Browse files
committed
[embedded] Add a embedded-libraries CMake target to simplify the test dependencies
1 parent 8c5d9e2 commit 75aed2c

File tree

7 files changed

+10
-15
lines changed

7 files changed

+10
-15
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "OFF")
167167
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
168168
endif()
169169

170+
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
171+
add_custom_target(embedded-libraries ALL)
172+
endif()
173+
170174
set(EMBEDDED_STDLIB_TARGET_TRIPLES)
171175

172176
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING)

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "OFF")
192192
endif()
193193
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENCY)
194194
add_custom_target(embedded-concurrency ALL)
195+
add_dependencies(embedded-libraries embedded-concurrency)
195196

196197
set(SWIFT_ENABLE_REFLECTION OFF)
197198
set(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT OFF)

stdlib/public/Platform/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
8282
set(SWIFT_ENABLE_REFLECTION OFF)
8383

8484
add_custom_target(embedded-darwin ALL)
85+
add_dependencies(embedded-libraries embedded-darwin)
8586
foreach(entry ${EMBEDDED_STDLIB_TARGET_TRIPLES})
8687
string(REGEX REPLACE "[ \t]+" ";" list "${entry}")
8788
list(GET list 0 arch)

stdlib/public/Synchronization/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
135135
# and only users of a library are going to actually compile any needed code.
136136
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
137137
add_custom_target(embedded-synchronization ALL)
138+
add_dependencies(embedded-libraries embedded-synchronization)
138139

139140
foreach(entry ${EMBEDDED_STDLIB_TARGET_TRIPLES})
140141
string(REGEX REPLACE "[ \t]+" ";" list "${entry}")

stdlib/public/Volatile/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ add_swift_target_library(swift_Volatile ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_S
2323

2424
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
2525
add_custom_target(embedded-volatile ALL)
26+
add_dependencies(embedded-libraries embedded-volatile)
2627
foreach(entry ${EMBEDDED_STDLIB_TARGET_TRIPLES})
2728
string(REGEX REPLACE "[ \t]+" ";" list "${entry}")
2829
list(GET list 0 arch)

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ add_swift_target_library(swiftCore
414414
# and only users of a library are going to actually compile any needed code.
415415
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
416416
add_custom_target(embedded-stdlib ALL)
417+
add_dependencies(embedded-libraries embedded-stdlib)
417418

418419
set(SWIFT_ENABLE_REFLECTION OFF)
419420
set(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT OFF)

test/CMakeLists.txt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,7 @@ foreach(SDK ${SWIFT_SDKS})
319319
endif()
320320

321321
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
322-
if(TARGET "embedded-stdlib")
323-
list(APPEND test_dependencies "embedded-stdlib")
324-
endif()
325-
if(TARGET "embedded-darwin")
326-
list(APPEND test_dependencies "embedded-darwin")
327-
endif()
328-
if(TARGET "embedded-concurrency")
329-
list(APPEND test_dependencies "embedded-concurrency")
330-
endif()
331-
if(TARGET "embedded-synchronization")
332-
list(APPEND test_dependencies "embedded-synchronization")
333-
endif()
334-
if(TARGET "embedded-volatile")
335-
list(APPEND test_dependencies "embedded-volatile")
336-
endif()
322+
list(APPEND test_dependencies "embedded-libraries")
337323
endif()
338324

339325
if(NOT "${COVERAGE_DB}" STREQUAL "")

0 commit comments

Comments
 (0)