Skip to content

Commit a9ac013

Browse files
committed
[SwiftCompilerSources] Make Package.swift static
`Package.swift` in the build directory and symlinking Sources directory wasn't great for source control and break points. Since C modules doesn't need the generated headers at this point, make `Package.swift` static again with a symlink to the string processing source directory.
1 parent ea1514b commit a9ac013

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

SwiftCompilerSources/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.swiftpm

SwiftCompilerSources/CMakeLists.txt

-22
Original file line numberDiff line numberDiff line change
@@ -267,25 +267,3 @@ else()
267267
endif()
268268

269269
endif()
270-
271-
# Configure 'SwiftCompilerModules' SwiftPM package. The 'Package.swift' will
272-
# be created at '${build_dir}/SwiftCompilerModulesPackage/Package.swift' and can
273-
# be built with 'swift-build'.
274-
# Note that this SwiftPM package itself is just for development purposes, and
275-
# is not actually used for the compiler building.
276-
set(swiftcompiler_modules_package_directory
277-
"${SWIFT_BINARY_DIR}/SwiftCompilerModulesPackage")
278-
configure_file(Package.swift.in
279-
"${swiftcompiler_modules_package_directory}/Package.swift" @ONLY)
280-
# SwiftPM requires all sources are inside the directory of 'Package.swift'.
281-
# Create symlinks to the actual source directories.
282-
execute_process(COMMAND
283-
"${CMAKE_COMMAND}" -E create_symlink
284-
"${CMAKE_CURRENT_SOURCE_DIR}/Sources"
285-
"${swiftcompiler_modules_package_directory}/Sources")
286-
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
287-
execute_process(COMMAND
288-
"${CMAKE_COMMAND}" -E create_symlink
289-
"${EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR}/Sources/_RegexParser"
290-
"${swiftcompiler_modules_package_directory}/_RegexParser_Sources")
291-
endif()

SwiftCompilerSources/Package.swift.in SwiftCompilerSources/Package.swift

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
// NOTE: This 'Package.swift.in' file is for CMake configure_file().
15-
// Generated 'Package.swift' can be found in
16-
// '${swift_build_dir}/SwiftCompilerSources/Package.swift'.
17-
1814
import PackageDescription
1915

2016
private extension Target {
@@ -23,9 +19,7 @@ private extension Target {
2319
"-Xfrontend", "-validate-tbd-against-ir=none",
2420
"-Xfrontend", "-enable-cxx-interop",
2521
// Bridging modules and headers
26-
"-Xcc", "-I", "-Xcc", "@SWIFT_SOURCE_DIR@/include",
27-
// Generated C headers
28-
"-Xcc", "-I", "-Xcc", "@CMAKE_BINARY_DIR@/include",
22+
"-Xcc", "-I", "-Xcc", "../include",
2923
"-cross-module-optimization"
3024
]),
3125
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../swift-experimental-string-processing/Sources/_RegexParser

0 commit comments

Comments
 (0)