Skip to content

Commit 5879740

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

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
@@ -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
@@ -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)