Skip to content

Commit 9fa54df

Browse files
committed
Explicitly link to static libraries
1 parent dc4ebfd commit 9fa54df

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

.github/workflows/windows-release-build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ jobs:
5353
-Xswiftc -static-stdlib `
5454
-Xswiftc -sdk `
5555
-Xswiftc $sdk `
56-
-Xcc -DCURL_STATICLIB `
57-
-Xcc -DLIBXML_STATIC
56+
-Xlinker /NODEFAULTLIB:curl -Xlinker libcurl.lib `
57+
-Xlinker /NODEFAULTLIB:xml2 -Xlinker libxml2s.lib `
58+
-Xlinker zlibstatic.lib `
59+
-Xlinker brotlidec.lib `
60+
-Xlinker brotlicommon.lib
5861
- name: Prepare artifacts directory
5962
shell: pwsh
6063
run: |

Package.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ swiftLintPluginDependencies = [.target(name: "SwiftLintBinary")]
2626
swiftLintPluginDependencies = [.target(name: "swiftlint")]
2727
#endif
2828

29-
// Linker flags for static Windows builds.
30-
let windowsStaticLinkerFlags: [LinkerSetting] =
31-
if ProcessInfo.processInfo.environment["SWIFTLINT_STATIC_WINDOWS_BUILD"] == nil {
32-
[]
33-
} else {
34-
[
35-
.linkedLibrary("libcurl.lib"),
36-
.linkedLibrary("zlibstatic.lib"),
37-
.linkedLibrary("brotlicommon.lib"),
38-
.linkedLibrary("brotlidec.lib"),
39-
]
40-
}
41-
4229
let package = Package(
4330
name: "SwiftLint",
4431
platforms: [.macOS(.v13)],
@@ -67,8 +54,7 @@ let package = Package(
6754
"SwiftLintFramework",
6855
"SwiftyTextTable",
6956
],
70-
swiftSettings: swiftFeatures + strictConcurrency,
71-
linkerSettings: windowsStaticLinkerFlags
57+
swiftSettings: swiftFeatures + strictConcurrency
7258
),
7359
.executableTarget(
7460
name: "swiftlint-dev",

0 commit comments

Comments
 (0)