Skip to content

Commit 394e907

Browse files
committed
CMake: Synchronization
Fixing sources used to build synchronization library. This aligns the synchronization source list with what is posted in the old build system. ``` set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES Mutex/DarwinImpl.swift Mutex/Mutex.swift ) set(SWIFT_SYNCHRONIZATION_LINUX_SOURCES Mutex/LinuxImpl.swift Mutex/Mutex.swift Mutex/SpinLoopHint.swift ) set(SWIFT_SYNCHRONIZATION_FREEBSD_SOURCES Mutex/FreeBSDImpl.swift Mutex/Mutex.swift ) set(SWIFT_SYNCHRONIZATION_WASM_SOURCES Mutex/Mutex.swift Mutex/WasmImpl.swift ) set(SWIFT_SYNCHRONIZATION_WINDOWS_SOURCES Mutex/Mutex.swift Mutex/WindowsImpl.swift ) set(SWIFT_SYNCHRONIZATION_OPENBSD_SOURCES Mutex/Mutex.swift Mutex/OpenBSDImpl.swift ) ``` This is specifically to fix this error when building for Linux: ``` /build/swift/Runtimes/Supplemental/Synchronization/Mutex/LinuxImpl.swift:99:19: error: cannot find '_tries' in scope 97 | // This value is controlled on a per architecture bases defined in 98 | // 'SpinLoopHint.swift'. 99 | var tries = _tries | `- error: cannot find '_tries' in scope 100 | 101 | repeat { /build/swift/Runtimes/Supplemental/Synchronization/Mutex/LinuxImpl.swift:126:9: error: cannot find '_spinLoopHint' in scope 124 | // effect of slowing down this loop if only by a little to preserve 125 | // energy. 126 | _spinLoopHint() | `- error: cannot find '_spinLoopHint' in scope 127 | } while tries != 0 128 | } ninja: build stopped: subcommand failed. ```
1 parent 5cc8264 commit 394e907

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Runtimes/Supplemental/Synchronization/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,18 @@ if(${PROJECT_NAME}_SINGLE_THREADED_MODE)
138138
else()
139139
target_sources(swiftSynchronization PRIVATE
140140
Mutex/Mutex.swift
141+
# Apple Sources
141142
$<$<PLATFORM_ID:Darwin>:Mutex/DarwinImpl.swift>
143+
# Android and Linux Sources
142144
$<$<PLATFORM_ID:Android,Linux>:Mutex/LinuxImpl.swift>
143-
$<$<PLATFORM_ID:Android,WASI>:Mutex/SpinLoopHint.swift>
145+
$<$<PLATFORM_ID:Android,Linux>:Mutex/SpinLoopHint.swift>
146+
# FreeBSD Sources
147+
$<$<PLATFORM_ID:FreeBSD>:Mutex/FreeBSDImpl.swift>
148+
# OpenBSD Sources
149+
$<$<PLATFORM_ID:OpenBSD>:Mutex/OpenBSDImpl.swift>
150+
# Wasm Sources
151+
$<$<PLATFORM_ID:WASI>:Mutex/WasmImpl.swift>
152+
# Windows Sources
144153
$<$<PLATFORM_ID:Windows>:Mutex/WindowsImpl.swift>)
145154
endif()
146155

0 commit comments

Comments
 (0)