Skip to content

Commit e5e4bba

Browse files
committed
[embedded] Add a embedded-libraries CMake target to simplify the test dependencies
1 parent db9232f commit e5e4bba

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ elseif(BOOTSTRAPPING_MODE STREQUAL "OFF")
164164
endif()
165165

166166
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
167+
add_custom_target(embedded-libraries ALL)
168+
167169
set(EMBEDDED_STDLIB_TARGET_TRIPLES)
168170
if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
169171
list(APPEND EMBEDDED_STDLIB_TARGET_TRIPLES

stdlib/public/Concurrency/CMakeLists.txt

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

195196
set(SWIFT_ENABLE_REFLECTION OFF)
196197
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
@@ -49,6 +49,7 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
4949
# and only users of a library are going to actually compile any needed code.
5050
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
5151
add_custom_target(embedded-synchronization ALL)
52+
add_dependencies(embedded-libraries embedded-synchronization)
5253

5354
foreach(entry ${EMBEDDED_STDLIB_TARGET_TRIPLES})
5455
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
@@ -415,6 +415,7 @@ add_swift_target_library(swiftCore
415415
# and only users of a library are going to actually compile any needed code.
416416
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
417417
add_custom_target(embedded-stdlib ALL)
418+
add_dependencies(embedded-libraries embedded-stdlib)
418419

419420
set(SWIFT_ENABLE_REFLECTION OFF)
420421
set(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT OFF)

test/CMakeLists.txt

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

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

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

0 commit comments

Comments
 (0)