swiftpm: disable -index-store-path Apple extension

This commit is contained in:
Stéphan Kochen
2023-02-01 08:29:36 +01:00
parent a34a8db902
commit 72fa71720b
2 changed files with 24 additions and 0 deletions
@@ -38,6 +38,7 @@ let
propagatedBuildInputs = [ Foundation ];
patches = [
./patches/cmake-disable-rpath.patch
./patches/disable-index-store.patch
./patches/disable-sandbox.patch
./patches/fix-clang-cxx.patch
(substituteAll {
@@ -0,0 +1,23 @@
The `-index-store-path` option is an Apple extension not available in our
Clang. Make it opt-in by default.
(It is assumed the `target.type == test` check is for Xcode support, because
there is no evidence of it in swift-corelibs-xctest.)
--- a/Sources/Build/BuildPlan.swift
+++ b/Sources/Build/BuildPlan.swift
@@ -103,14 +103,7 @@ extension BuildParameters {
case .off:
addIndexStoreArguments = false
case .auto:
- if configuration == .debug {
- addIndexStoreArguments = true
- } else if target.type == .test {
- // Test discovery requires an index store for the test target to discover the tests
- addIndexStoreArguments = true
- } else {
addIndexStoreArguments = false
- }
}
if addIndexStoreArguments {