|
| 1 | +diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake |
| 2 | +index 6d93e52f1d5..9ab79aeb9d6 100644 |
| 3 | +--- a/cmake/modules/AddSwift.cmake |
| 4 | ++++ b/cmake/modules/AddSwift.cmake |
| 5 | +@@ -715,6 +715,7 @@ function(add_swift_host_tool executable) |
| 6 | + |
| 7 | + # Include the abi stable system stdlib in our rpath. |
| 8 | + list(APPEND RPATH_LIST "/usr/lib/swift") |
| 9 | ++ list(APPEND RPATH_LIST "${SWIFTLIB_DIR}") |
| 10 | + |
| 11 | + elseif(BOOTSTRAPPING_MODE STREQUAL "CROSSCOMPILE-WITH-HOSTLIBS") |
| 12 | + |
| 13 | +@@ -731,6 +732,7 @@ function(add_swift_host_tool executable) |
| 14 | + |
| 15 | + # Include the abi stable system stdlib in our rpath. |
| 16 | + list(APPEND RPATH_LIST "/usr/lib/swift") |
| 17 | ++ list(APPEND RPATH_LIST "@executable_path/../lib") |
| 18 | + |
| 19 | + elseif(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS") |
| 20 | + # Add the SDK directory for the host platform. |
| 21 | +@@ -798,7 +800,7 @@ function(add_swift_host_tool executable) |
| 22 | + if(BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS") |
| 23 | + set_target_properties(${executable} PROPERTIES |
| 24 | + BUILD_WITH_INSTALL_RPATH YES |
| 25 | +- INSTALL_RPATH "${host_lib_dir}") |
| 26 | ++ INSTALL_RPATH "${host_lib_dir};$ORIGIN/../lib") |
| 27 | + else() |
| 28 | + set_target_properties(${executable} PROPERTIES |
| 29 | + BUILD_WITH_INSTALL_RPATH YES |
1 | 30 | diff --git a/include/swift/DriverTool/FrontendObserver.h b/include/swift/DriverTool/FrontendObserver.h
|
2 | 31 | new file mode 100644
|
3 | 32 | index 00000000000..4ac9b299a13
|
@@ -28,49 +57,68 @@ index 184e6196918..ef5c3eafe69 100644
|
28 | 57 | // TODO: maybe enhance this interface to hear about IRGen and LLVM
|
29 | 58 | // progress.
|
30 | 59 | };
|
| 60 | +diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt |
| 61 | +index ec3fa2c853b..9bf73c9b2fc 100644 |
| 62 | +--- a/lib/AST/CMakeLists.txt |
| 63 | ++++ b/lib/AST/CMakeLists.txt |
| 64 | +@@ -58,7 +58,6 @@ add_swift_host_library(swiftAST STATIC |
| 65 | + GenericParamList.cpp |
| 66 | + GenericSignature.cpp |
| 67 | + GenericSignatureBuilder.cpp |
| 68 | +- Identifier.cpp |
| 69 | + ImportCache.cpp |
| 70 | + IndexSubset.cpp |
| 71 | + InlinableText.cpp |
| 72 | +@@ -122,6 +121,10 @@ add_swift_host_library(swiftAST STATIC |
| 73 | + ${SWIFTAST_LLVM_LINK_COMPONENTS} |
| 74 | + ) |
| 75 | + |
| 76 | ++add_swift_host_library(swiftIdentifier SHARED |
| 77 | ++ Identifier.cpp |
| 78 | ++ ) |
| 79 | ++ |
| 80 | + if(SWIFT_FORCE_OPTIMIZED_TYPECHECKER) |
| 81 | + if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL MSVC) |
| 82 | + target_compile_options(swiftAST PRIVATE /O2 /Ob2) |
| 83 | +@@ -152,7 +155,7 @@ if(NOT SWIFT_BUILD_ONLY_SYNTAXPARSERLIB) |
| 84 | + endif() |
| 85 | + |
| 86 | + target_link_libraries(swiftAST |
| 87 | +- PUBLIC swiftBasic |
| 88 | ++ PUBLIC swiftBasic swiftIdentifier |
| 89 | + PRIVATE swiftSyntax) |
| 90 | + if(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB) |
| 91 | + # Remove dependencies from clangBasic to avoid bringing along some llvm |
31 | 92 | diff --git a/lib/DriverTool/CMakeLists.txt b/lib/DriverTool/CMakeLists.txt
|
32 |
| -index 869c00fece9..8787598e2bf 100644 |
| 93 | +index 869c00fece9..21610d8eb95 100644 |
33 | 94 | --- a/lib/DriverTool/CMakeLists.txt
|
34 | 95 | +++ b/lib/DriverTool/CMakeLists.txt
|
35 |
| -@@ -9,21 +9,34 @@ set(driver_sources_and_options |
36 |
| - |
37 |
| - set(driver_common_libs |
38 |
| - swiftAPIDigester |
39 |
| -+ swiftCompilerModules |
40 |
| - swiftDriver |
41 |
| - swiftFrontendTool |
| 96 | +@@ -14,16 +14,24 @@ set(driver_common_libs |
42 | 97 | swiftSymbolGraphGen
|
43 | 98 | LLVMBitstreamReader)
|
44 | 99 |
|
45 |
| --add_swift_host_library(swiftDriverTool STATIC |
46 |
| -+add_swift_host_library(swiftFrontendObserver STATIC |
| 100 | ++add_swift_host_library(swiftFrontendObserver SHARED |
47 | 101 | + swift_frontend_observer.cpp)
|
48 | 102 | +target_link_libraries(swiftFrontendObserver
|
49 | 103 | + PUBLIC
|
50 | 104 | + swiftFrontendTool)
|
51 | 105 | +
|
52 |
| -+add_swift_host_library(swiftPluggableObserverDriverTool STATIC |
| 106 | + add_swift_host_library(swiftDriverTool STATIC |
53 | 107 | ${driver_sources_and_options}
|
54 | 108 | )
|
55 |
| --target_link_libraries(swiftDriverTool |
56 |
| -+target_link_libraries(swiftPluggableObserverDriverTool |
| 109 | + target_link_libraries(swiftDriverTool |
57 | 110 | PUBLIC
|
58 |
| - ${driver_common_libs}) |
| 111 | +- ${driver_common_libs}) |
| 112 | ++ ${driver_common_libs} |
| 113 | ++ swiftFrontendObserver) |
59 | 114 |
|
60 |
| -+add_library(swiftDriverTool INTERFACE) |
61 |
| -+target_link_libraries(swiftDriverTool INTERFACE |
62 |
| -+ swiftPluggableObserverDriverTool |
63 |
| -+ swiftFrontendObserver) |
64 |
| -+ |
65 | 115 | # If building as part of clang, make sure the headers are installed.
|
66 | 116 | if(NOT SWIFT_BUILT_STANDALONE)
|
67 |
| -- add_dependencies(swiftDriverTool clang-resource-headers) |
68 |
| -+ add_dependencies(swiftPluggableObserverDriverTool clang-resource-headers) |
| 117 | + add_dependencies(swiftDriverTool clang-resource-headers) |
69 | 118 | endif()
|
70 | 119 |
|
71 |
| --set_swift_llvm_is_available(swiftDriverTool) |
72 | 120 | +set_swift_llvm_is_available(swiftFrontendObserver)
|
73 |
| -+set_swift_llvm_is_available(swiftPluggableObserverDriverTool) |
| 121 | + set_swift_llvm_is_available(swiftDriverTool) |
74 | 122 | diff --git a/lib/DriverTool/driver.cpp b/lib/DriverTool/driver.cpp
|
75 | 123 | index f71e2de9eae..a500e30827f 100644
|
76 | 124 | --- a/lib/DriverTool/driver.cpp
|
@@ -151,3 +199,12 @@ index 811fb912f8a..afa2034aa71 100644
|
151 | 199 | void FrontendObserver::performedSILGeneration(SILModule &module) {}
|
152 | 200 | void FrontendObserver::performedSILProcessing(SILModule &module) {}
|
153 | 201 | +void FrontendObserver::finished(int status) {}
|
| 202 | +diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt |
| 203 | +index a5dc3ccb845..30667ae51f9 100644 |
| 204 | +--- a/tools/driver/CMakeLists.txt |
| 205 | ++++ b/tools/driver/CMakeLists.txt |
| 206 | +@@ -123,4 +123,3 @@ add_dependencies(editor-integration swift-frontend) |
| 207 | + swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-indent${CMAKE_EXECUTABLE_SUFFIX}" |
| 208 | + DESTINATION "bin" |
| 209 | + COMPONENT editor-integration) |
| 210 | +- |
0 commit comments