Skip to content

Commit

Permalink
Ensure to link unit tests against the Swift libraries when using the …
Browse files Browse the repository at this point in the history
…new parser
  • Loading branch information
DougGregor authored and pull[bot] committed Sep 2, 2022
1 parent 23ea936 commit 4840013
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)

# Workaround to make lldb happy: we have to explicitly add all swift compiler modules
# to the linker command line.
set(swift_ast_path_flags "-Wl")
set(swift_ast_path_flags " -Wl")
get_property(modules GLOBAL PROPERTY swift_compiler_modules)
foreach(module ${modules})
get_target_property(module_file "SwiftModule${module}" "module_file")
Expand Down
4 changes: 4 additions & 0 deletions cmake/modules/AddSwiftUnittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@ function(add_swift_unittest test_dirname)
LINK_FLAGS " -fsanitize=thread")
endif()
endif()

if (SWIFT_SWIFT_PARSER)
_add_swift_runtime_link_flags(${test_dirname} "../../lib" "")
endif()
endfunction()

0 comments on commit 4840013

Please sign in to comment.