@@ -77,15 +77,40 @@ add_swift_parser_link_libraries(swift-frontend)
77
77
# to ensure that `swiftc` forwards to the standalone driver when invoked.
78
78
swift_create_early_driver_copies (swift-frontend )
79
79
80
- swift_create_post_build_symlink (swift-frontend
81
- SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
82
- DESTINATION "swift${CMAKE_EXECUTABLE_SUFFIX} "
83
- WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
80
+ # If a `swift-driver` executable adjacent to the `swift-frontend` executable exists
81
+ # then the `swift` and `swiftc` symlinks should point to it by-default
82
+ if (EXISTS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-driver${CMAKE_EXECUTABLE_SUFFIX} " AND EXISTS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-help${CMAKE_EXECUTABLE_SUFFIX} " )
83
+ message (STATUS "Pointing 'swift' and 'swiftc' symlinks at 'swift-driver'." )
84
+ swift_create_post_build_symlink (swift-frontend
85
+ SOURCE "swift-driver${CMAKE_EXECUTABLE_SUFFIX} "
86
+ DESTINATION "swift${CMAKE_EXECUTABLE_SUFFIX} "
87
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
88
+ swift_create_post_build_symlink (swift-frontend
89
+ SOURCE "swift-driver${CMAKE_EXECUTABLE_SUFFIX} "
90
+ DESTINATION "swiftc${CMAKE_EXECUTABLE_SUFFIX} "
91
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
84
92
85
- swift_create_post_build_symlink (swift-frontend
86
- SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
87
- DESTINATION "swiftc${CMAKE_EXECUTABLE_SUFFIX} "
88
- WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
93
+ message (STATUS "Pointing 'swift-legacy-driver' and 'swiftc-legacy-driver' symlinks at 'swift-frontend'." )
94
+ swift_create_post_build_symlink (swift-frontend
95
+ SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
96
+ DESTINATION "swift-legacy-driver${CMAKE_EXECUTABLE_SUFFIX} "
97
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
98
+ swift_create_post_build_symlink (swift-frontend
99
+ SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
100
+ DESTINATION "swiftc-legacy-driver${CMAKE_EXECUTABLE_SUFFIX} "
101
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
102
+ else ()
103
+ message (STATUS "Pointing 'swift' and 'swiftc' symlinks at 'swift-frontend' - no early SwiftDriver build found." )
104
+ swift_create_post_build_symlink (swift-frontend
105
+ SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
106
+ DESTINATION "swift${CMAKE_EXECUTABLE_SUFFIX} "
107
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
108
+
109
+ swift_create_post_build_symlink (swift-frontend
110
+ SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
111
+ DESTINATION "swiftc${CMAKE_EXECUTABLE_SUFFIX} "
112
+ WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
113
+ endif ()
89
114
90
115
swift_create_post_build_symlink (swift-frontend
91
116
SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX} "
@@ -157,15 +182,6 @@ swift_create_post_build_symlink(swift-frontend
157
182
DESTINATION "swift-parse-test${CMAKE_EXECUTABLE_SUFFIX} "
158
183
WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR} " )
159
184
160
- add_swift_tool_symlink (swift swift-frontend compiler )
161
- add_swift_tool_symlink (swiftc swift-frontend compiler )
162
- add_swift_tool_symlink (swift-symbolgraph-extract swift-frontend compiler )
163
- add_swift_tool_symlink (swift-api-extract swift-frontend compiler )
164
- add_swift_tool_symlink (swift-autolink-extract swift-frontend autolink-driver )
165
- add_swift_tool_symlink (swift-indent swift-frontend editor-integration )
166
- add_swift_tool_symlink (swift-api-digester swift-frontend compiler )
167
- add_swift_tool_symlink (swift-cache-tool swift-frontend compiler )
168
-
169
185
add_dependencies (compiler swift-frontend )
170
186
swift_install_in_component (FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift${CMAKE_EXECUTABLE_SUFFIX} "
171
187
DESTINATION "bin"
@@ -193,4 +209,17 @@ add_dependencies(editor-integration swift-frontend)
193
209
swift_install_in_component (FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-indent${CMAKE_EXECUTABLE_SUFFIX} "
194
210
DESTINATION "bin"
195
211
COMPONENT editor-integration )
196
-
212
+ if (EXISTS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-driver${CMAKE_EXECUTABLE_SUFFIX} " AND EXISTS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-help${CMAKE_EXECUTABLE_SUFFIX} " )
213
+ swift_install_in_component (PROGRAMS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-driver${CMAKE_EXECUTABLE_SUFFIX} "
214
+ DESTINATION "bin"
215
+ COMPONENT compiler )
216
+ swift_install_in_component (PROGRAMS "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-help${CMAKE_EXECUTABLE_SUFFIX} "
217
+ DESTINATION "bin"
218
+ COMPONENT compiler )
219
+ swift_install_in_component (FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swiftc-legacy-driver${CMAKE_EXECUTABLE_SUFFIX} "
220
+ DESTINATION "bin"
221
+ COMPONENT compiler )
222
+ swift_install_in_component (FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR} /swift-legacy-driver${CMAKE_EXECUTABLE_SUFFIX} "
223
+ DESTINATION "bin"
224
+ COMPONENT compiler )
225
+ endif ()
0 commit comments