Skip to content

[5.9 🍒][Dependency Scanning] Build libSwiftScan with Swift Modules required for parsing regex #65373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tools/libSwiftScan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ set(LLVM_EXPORTED_SYMBOL_FILE

add_swift_host_library(libSwiftScan SHARED
libSwiftScan.cpp
c-include-check.c)
c-include-check.c
HAS_SWIFT_MODULES)

if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
# Workaround for a linker crash related to autolinking: rdar://77839981
Expand All @@ -23,7 +24,7 @@ target_link_libraries(libSwiftScan PRIVATE
swiftDriverTool
swiftStaticMirror
swiftRemoteInspection
swiftCompilerStub)
swiftCompilerModules)

set_target_properties(libSwiftScan
PROPERTIES
Expand Down
4 changes: 4 additions & 0 deletions tools/libSwiftScan/libSwiftScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//

#include "swift/Basic/LLVMInitialize.h"
#include "swift/Basic/InitializeSwiftModules.h"
#include "swift/DriverTool/DriverTool.h"
#include "swift/DependencyScan/DependencyScanImpl.h"
#include "swift/DependencyScan/DependencyScanningTool.h"
Expand Down Expand Up @@ -114,6 +115,9 @@ void swiftscan_scanner_cache_reset(swiftscan_scanner_t scanner) {

swiftscan_scanner_t swiftscan_scanner_create(void) {
INITIALIZE_LLVM();
// We must initialize the swift modules responsible for parsing functionality,
// such as parsing regex.
initializeSwiftParseModules();
return wrap(new DependencyScanningTool());
}

Expand Down