Skip to content

Commit c119f3f

Browse files
authored
Merge pull request swiftlang#80725 from kubamracek/embedded-concurrency-for-non-darwin
[embedded] Start building Concurrency.swiftmodule/.a for non-Darwin target triples too
2 parents 99afbc1 + faefcfd commit c119f3f

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -272,31 +272,23 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
272272
list(GET list 1 mod)
273273
list(GET list 2 triple)
274274

275+
set(extra_c_compile_flags)
276+
set(extra_swift_compile_flags)
277+
275278
if (SWIFT_HOST_VARIANT STREQUAL "linux")
276279
if(NOT "${mod}" MATCHES "-linux-gnu$")
277280
continue()
278281
endif()
279-
set(extra_c_compile_flags)
280-
set(extra_swift_compile_flags)
281282
elseif (SWIFT_HOST_VARIANT STREQUAL "macosx")
282-
if(NOT "${mod}" MATCHES "-macos$")
283-
continue()
284-
endif()
285-
if("${mod}" MATCHES "riscv")
286-
continue()
287-
endif()
288-
if("${mod}" MATCHES "armv6m")
283+
if(NOT "${mod}" MATCHES "x86_64|arm64|arm64e|armv7|armv7m|armv7em")
289284
continue()
290285
endif()
291286

292-
if("${mod}" MATCHES "-macos$")
293-
set(extra_c_compile_flags -ffreestanding -stdlib=libc++)
294-
set(extra_swift_compile_flags -Xcc -ffreestanding)
287+
if(NOT "${mod}" MATCHES "-apple-" OR "${mod}" MATCHES "-none-macho")
288+
# Host is macOS with a macOS SDK. To be able to build the C++ Concurrency runtime for non-Darwin targets using the macOS SDK,
289+
# we need to pass some extra flags and search paths.
290+
set(extra_c_compile_flags -stdlib=libc++ -isystem${SWIFT_SDK_OSX_PATH}/usr/include/c++/v1 -isystem${SWIFT_SDK_OSX_PATH}/usr/include -D__APPLE__)
295291
endif()
296-
297-
elseif (SWIFT_HOST_VARIANT STREQUAL "wasi")
298-
set(extra_c_compile_flags)
299-
set(extra_swift_compile_flags)
300292
endif()
301293

302294
set(SWIFT_SDK_embedded_THREADING_PACKAGE none)

0 commit comments

Comments
 (0)