diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index 4bf1d691bd326..71f08914d9e2a 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -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") diff --git a/cmake/modules/AddSwiftUnittests.cmake b/cmake/modules/AddSwiftUnittests.cmake index 277347bb7a3f7..cdb522e9fc464 100644 --- a/cmake/modules/AddSwiftUnittests.cmake +++ b/cmake/modules/AddSwiftUnittests.cmake @@ -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()