Skip to content

Commit 4df6010

Browse files
committed
correct build flags and tls access
1 parent 9633fd5 commit 4df6010

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

stdlib/public/Observation/Sources/Observation/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212

1313
set(SWIFT_OBSERVATION_SWIFT_FLAGS)
1414

15+
set(SWIFT_HOST_LIBRARIES_SUBDIRECTORY "swift/host")
16+
1517
list(APPEND SWIFT_OBSERVATION_SWIFT_FLAGS
16-
"-enable-experimental-feature Macros")
18+
"-enable-experimental-feature" "Macros"
19+
"-load-plugin-library"
20+
${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY})
1721

1822
add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
1923
KeyPaths.swift
@@ -31,7 +35,7 @@ add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS
3135
SWIFT_COMPILE_FLAGS
3236
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
3337
${SWIFT_OBSERVATION_SWIFT_FLAGS}
34-
SWIFT_MODULE_DEPENDS _Concurrency
38+
SWIFT_MODULE_DEPENDS _Concurrency ObservationMacros
3539
INSTALL_IN_COMPONENT stdlib
3640

3741
MACCATALYST_BUILD_FLAVOR "zippered"

stdlib/public/Observation/Sources/Observation/Macros.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
#if compiler(>=5.8) && hasAttribute(attached)
1213
@available(SwiftStdlib 5.9, *)
1314
@attached(member)
1415
@attached(memberAttribute)
1516
public macro Observable() = #externalMacro(module: "ObservationMacros", type: "ObservableMacro")
1617

1718
@available(SwiftStdlib 5.9, *)
1819
@attached(accessor)
19-
public macro ObservableProperty() = #externalMacro(module: "ObservationMacros", type: "ObservablePropertyMacro")
20+
public macro ObservableProperty() = #externalMacro(module: "ObservationMacros", type: "ObservablePropertyMacro")
21+
#endif

stdlib/public/Observation/Sources/Observation/ThreadLocal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "swift/Runtime/Once.h"
1515
#include "swift/Threading/ThreadLocalStorage.h"
1616

17-
static SWIFT_THREAD_LOCAL_TYPE(void *, tls_key::observation_transaction) Value;
17+
static SWIFT_THREAD_LOCAL_TYPE(void *, swift::tls_key::observation_transaction) Value;
1818

1919
extern "C" SWIFT_CC(swift)
2020
void *_swift_observation_tls_get() {

0 commit comments

Comments
 (0)