|
| 1 | +add_subdirectory(InternalShims) |
| 2 | + |
| 3 | +add_library(swift_Concurrency |
| 4 | + Actor.cpp |
| 5 | + AsyncLet.cpp |
| 6 | + AsyncStream.cpp |
| 7 | + Clock.cpp |
| 8 | + ConcurrencyHooks.cpp |
| 9 | + EmbeddedSupport.cpp |
| 10 | + Error.cpp |
| 11 | + ExecutorChecks.cpp |
| 12 | + GlobalExecutor.cpp |
| 13 | + Setup.cpp |
| 14 | + Task.cpp |
| 15 | + TaskAlloc.cpp |
| 16 | + TaskGroup.cpp |
| 17 | + TaskLocal.cpp |
| 18 | + TaskStatus.cpp |
| 19 | + ThreadingError.cpp |
| 20 | + TracingSignpost.cpp |
| 21 | + "${PROJECT_SOURCE_DIR}/CompatibilityOverride/CompatibilityOverride.cpp" |
| 22 | + "${PROJECT_SOURCE_DIR}/linker-support/magic-symbols-for-install-name.c" |
| 23 | + Actor.swift |
| 24 | + AsyncCompactMapSequence.swift |
| 25 | + AsyncDropFirstSequence.swift |
| 26 | + AsyncDropWhileSequence.swift |
| 27 | + AsyncFilterSequence.swift |
| 28 | + AsyncFlatMapSequence.swift |
| 29 | + AsyncIteratorProtocol.swift |
| 30 | + AsyncLet.swift |
| 31 | + AsyncMapSequence.swift |
| 32 | + AsyncPrefixSequence.swift |
| 33 | + AsyncPrefixWhileSequence.swift |
| 34 | + AsyncSequence.swift |
| 35 | + AsyncStream.swift |
| 36 | + AsyncStreamBuffer.swift |
| 37 | + AsyncThrowingCompactMapSequence.swift |
| 38 | + AsyncThrowingDropWhileSequence.swift |
| 39 | + AsyncThrowingFilterSequence.swift |
| 40 | + AsyncThrowingFlatMapSequence.swift |
| 41 | + AsyncThrowingMapSequence.swift |
| 42 | + AsyncThrowingPrefixWhileSequence.swift |
| 43 | + AsyncThrowingStream.swift |
| 44 | + CheckedContinuation.swift |
| 45 | + Clock.swift |
| 46 | + ContinuousClock.swift |
| 47 | + Deque/_DequeBuffer.swift |
| 48 | + Deque/_DequeBufferHeader.swift |
| 49 | + Deque/_DequeSlot.swift |
| 50 | + Deque/_UnsafeWrappedBuffer.swift |
| 51 | + Deque/Compatibility.swift |
| 52 | + Deque/Deque.swift |
| 53 | + Deque/Deque+Codable.swift |
| 54 | + Deque/Deque+Collection.swift |
| 55 | + Deque/Deque+CustomDebugStringConvertible.swift |
| 56 | + Deque/Deque+CustomReflectable.swift |
| 57 | + Deque/Deque+CustomStringConvertible.swift |
| 58 | + Deque/Deque+Equatable.swift |
| 59 | + Deque/Deque+ExpressibleByArrayLiteral.swift |
| 60 | + Deque/Deque+Extras.swift |
| 61 | + Deque/Deque+Hashable.swift |
| 62 | + Deque/Deque+Storage.swift |
| 63 | + Deque/Deque+Testing.swift |
| 64 | + Deque/Deque+UnsafeHandle.swift |
| 65 | + Deque/UnsafeMutableBufferPointer+Utilities.swift |
| 66 | + DiscardingTaskGroup.swift |
| 67 | + Errors.swift |
| 68 | + Executor.swift |
| 69 | + ExecutorAssertions.swift |
| 70 | + GlobalActor.swift |
| 71 | + GlobalConcurrentExecutor.swift |
| 72 | + MainActor.swift |
| 73 | + PartialAsyncTask.swift |
| 74 | + SourceCompatibilityShims.swift |
| 75 | + SuspendingClock.swift |
| 76 | + Task.swift |
| 77 | + Task+TaskExecutor.swift |
| 78 | + TaskCancellation.swift |
| 79 | + TaskGroup.swift |
| 80 | + TaskGroup+TaskExecutor.swift |
| 81 | + TaskLocal.swift |
| 82 | + TaskSleep.swift |
| 83 | + TaskSleepDuration.swift) |
| 84 | +include(${SwiftCore_CONCURRENCY_GLOBAL_EXECUTOR}.cmake) |
| 85 | +target_compile_definitions(swift_Concurrency PRIVATE |
| 86 | + $<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_TARGET_LIBRARY_NAME=swift_Concurrency> |
| 87 | + # NOTE: VS2017 <15.8 would round clamp alignment to alignof(max_align_t) which |
| 88 | + # was non-conformant. Indicate that we wish to use extended alignment. |
| 89 | + $<$<AND:$<PLATFORM_ID:Windows>,$<COMPILE_LANGUAGE:C,CXX>>:-D_ENABLE_EXTENDED_ALIGNED_STORAGE=1> |
| 90 | + $<$<COMPILE_LANGUAGE:C,CXX>:-D__STDC_WANT_LIB_EXT1__=1>) |
| 91 | +target_compile_options(swift_Concurrency PRIVATE |
| 92 | + $<$<COMPILE_LANGUAGE:Swift>:-parse-stdlib> |
| 93 | + # NOTE: do not remove until `IsolatedAny` is on by default in all supported |
| 94 | + # compilers. |
| 95 | + "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature IsolatedAny>" |
| 96 | + # NOTE: enable the async frame pointer on Darwin to faciliate debugging. |
| 97 | + $<$<AND:$<PLATFORM_ID:Darwin>,$<COMPILE_LANGUAGE:C,CXX>>:-fswift-async-fp=always> |
| 98 | + "$<$<AND:$<PLATFORM_ID:Darwin>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -swift-async-frame-pointer=always>" |
| 99 | + "$<$<AND:$<BOOL:${BUILD_SHARED_LIBS}>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xcc -Dswift_Concurrency_EXPORTS>") |
| 100 | +target_include_directories(swift_Concurrency PRIVATE |
| 101 | + # FIXME: Use of `swift/Runtime/...`, `swift/ABI/...`, and `swift/Demangling/...` |
| 102 | + "${SwiftCore_SWIFTC_SOURCE_DIR}/include" |
| 103 | + # FIXME: grant access to `runtime/CMakeConfig.h` which should be available |
| 104 | + # through the swiftRuntime target. |
| 105 | + "${PROJECT_BINARY_DIR}/include") |
| 106 | +target_link_libraries(swift_Concurrency PRIVATE |
| 107 | + swiftShims |
| 108 | + swiftConcurrencyInternalShims |
| 109 | + $<$<BOOL:${BUILD_SHARED_LIBS}>:swiftThreading> |
| 110 | + $<$<PLATFORM_ID:Windows>:Synchronization> |
| 111 | + $<$<PLATFORM_ID:Windows>:mincore> |
| 112 | + # Link to the runtime that we are just building. |
| 113 | + swiftCore |
| 114 | + $<$<NOT:$<PLATFORM_ID:Darwin>>:swiftrt>) |
| 115 | +target_link_options(swift_Concurrency PRIVATE |
| 116 | + -nostartfiles) |
| 117 | +set_target_properties(swift_Concurrency PROPERTIES |
| 118 | + Swift_MODULE_NAME _Concurrency) |
| 119 | + |
| 120 | +install(TARGETS swift_Concurrency |
| 121 | + ARCHIVE DESTINATION "${SwiftCore_INSTALL_LIBDIR}" |
| 122 | + LIBRARY DESTINATION "${SwiftCore_INSTALL_LIBDIR}" |
| 123 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 124 | +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/_Concurrency.swiftmodule" |
| 125 | + DESTINATION "${SwiftCore_INSTALL_SWIFTMODULEDIR}/_Concurrency.swiftmodule" |
| 126 | + RENAME "${SwiftCore_MODULE_TRIPLE}.swiftmodule") |
| 127 | +emit_swift_interface(swift_Concurrency) |
| 128 | +install_swift_interface(swift_Concurrency) |
0 commit comments