Skip to content

Commit 4375109

Browse files
committed
Make linkage and dependencies a bit more coheasive in cmake for observation macros
1 parent f5fa395 commit 4375109

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/Macros/Sources/ObservationMacros/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@ target_compile_options("${library_name}" PRIVATE
6262
-emit-module-interface-path;
6363
"${module_interface_file}" ;
6464
-I ${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY};
65-
-Xlinker -L${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY};
6665
-target;${target}>)
6766

67+
target_link_libraries(${library_name}
68+
PRIVATE
69+
SwiftSyntax::SwiftSyntax
70+
SwiftSyntax::SwiftSyntaxMacros
71+
)
6872

6973
swift_install_in_component(TARGETS "${library_name}"
7074
RUNTIME
@@ -83,5 +87,3 @@ swift_install_in_component(TARGETS "${library_name}"
8387
swift_install_in_component(DIRECTORY "${module_base}"
8488
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY}"
8589
COMPONENT compiler)
86-
87-
# set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${library_name})

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ add_swift_target_library(swiftObservation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS
3232
ThreadLocal.cpp
3333
ThreadLocal.swift
3434

35+
DEPENDS ObservationMacros
36+
3537
SWIFT_COMPILE_FLAGS
3638
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
3739
${SWIFT_OBSERVATION_SWIFT_FLAGS}

0 commit comments

Comments
 (0)