Skip to content

Commit 445c819

Browse files
committed
Workaround for getting libSwiftSyntax built as a dependency in the graph
1 parent b810212 commit 445c819

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Macros/Sources/ObservationMacros/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ add_custom_command_target(
5151
COMMAND "${CMAKE_COMMAND}" -E rm -f "${module_file}"
5252
OUTPUT ${module_base}
5353
COMMENT "Generating module directory for ${module_name}")
54-
add_dependencies(${library_name} ${create_module_dirs_dependency_target})
54+
add_dependencies(${library_name}
55+
${create_module_dirs_dependency_target}
56+
libSwiftScan # Placeholder that gets SwiftSyntax et-al built
57+
)
5558

5659
# Build the module with library evolution enabled and install into the
5760
# appropriate locations.
@@ -62,12 +65,13 @@ target_compile_options("${library_name}" PRIVATE
6265
-emit-module-interface-path;
6366
"${module_interface_file}" ;
6467
-I ${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY};
68+
-Xlinker -L${CMAKE_BINARY_DIR}/lib/${SWIFT_HOST_LIBRARIES_SUBDIRECTORY};
6569
-target;${target}>)
6670

6771
target_link_libraries(${library_name}
6872
PRIVATE
69-
SwiftSyntax::SwiftSyntax
70-
SwiftSyntax::SwiftSyntaxMacros
73+
SwiftSyntax
74+
SwiftSyntaxMacros
7175
)
7276

7377
swift_install_in_component(TARGETS "${library_name}"

0 commit comments

Comments
 (0)