Skip to content

Commit 9e38714

Browse files
committed
Ensure to link unit tests against the Swift libraries when using the new parser
1 parent 3f9f16f commit 9e38714

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
504504
505505
# Workaround to make lldb happy: we have to explicitly add all swift compiler modules
506506
# to the linker command line.
507-
set(swift_ast_path_flags "-Wl")
507+
set(swift_ast_path_flags " -Wl")
508508
get_property(modules GLOBAL PROPERTY swift_compiler_modules)
509509
foreach(module ${modules})
510510
get_target_property(module_file "SwiftModule${module}" "module_file")

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,9 @@ function(add_swift_unittest test_dirname)
7878
LINK_FLAGS " -fsanitize=thread")
7979
endif()
8080
endif()
81+
82+
if (SWIFT_SWIFT_PARSER)
83+
_add_swift_runtime_link_flags(${test_dirname} "../../lib" "")
84+
endif()
8185
endfunction()
8286

0 commit comments

Comments
 (0)