Skip to content

Commit a511f46

Browse files
compnerdHiroshi Yamauchiandrurogerz
committed
GHA: tweak the library naming for static libraries
This was changed upstream to use `lib` prefix for static libraries on Windows for Swift. Apply the necessary build changes to ensure that the build system is aware of this. Co-authored-by: Hiroshi Yamauchi <[email protected]> Co-authored-by: Andrew Rogers <[email protected]>
1 parent 701485b commit a511f46

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ jobs:
380380
"cxx": "cl",
381381
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
382382
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
383-
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
383+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib",
384384
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64"
385385
},
386386
{
@@ -394,7 +394,7 @@ jobs:
394394
"cxx": "cl",
395395
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
396396
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
397-
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
397+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib",
398398
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
399399
}
400400
]
@@ -413,7 +413,7 @@ jobs:
413413
"cxx": "cl",
414414
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
415415
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
416-
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\"",
416+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}\" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib",
417417
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64"
418418
}
419419
]

.github/workflows/swift-toolchain.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ jobs:
10791079
-D CMAKE_CXX_COMPILER="${{ steps.setup-context.outputs.cxx }}" `
10801080
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
10811081
-D CMAKE_CXX_FLAGS="${{ steps.setup-context.outputs.cxxflags }}" `
1082+
-D CMAKE_STATIC_LIBRARY_PREFIX_Swift= `
10821083
-D CMAKE_Swift_COMPILER="${{ steps.setup-context.outputs.swiftc }}" `
10831084
-D CMAKE_Swift_COMPILER_WORKS=YES `
10841085
-D CMAKE_Swift_FLAGS="${{ steps.setup-context.outputs.swiftflags }}" `
@@ -1600,7 +1601,7 @@ jobs:
16001601
swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }}
16011602
os: Windows
16021603
llvm_flags:
1603-
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
1604+
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib'
16041605
extra_flags:
16051606

16061607
- arch: arm64
@@ -1614,8 +1615,8 @@ jobs:
16141615
swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }}
16151616
os: Windows
16161617
llvm_flags:
1617-
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
1618-
extra_flags:
1618+
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib'
1619+
extra_flags:
16191620

16201621
- arch: x86
16211622
cpu: 'i686'
@@ -2029,7 +2030,7 @@ jobs:
20292030
cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}
20302031
swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }}
20312032
os: Windows
2032-
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
2033+
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib'
20332034
extra_flags:
20342035

20352036
- arch: arm64
@@ -2042,7 +2043,7 @@ jobs:
20422043
cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}
20432044
swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }}
20442045
os: Windows
2045-
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
2046+
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib'
20462047
extra_flags:
20472048

20482049
- arch: x86
@@ -2055,7 +2056,7 @@ jobs:
20552056
cxxflags: ${{ inputs.WINDOWS_CMAKE_CXX_FLAGS }}
20562057
swiftflags: ${{ inputs.CMAKE_Swift_FLAGS }}
20572058
os: Windows
2058-
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}"'
2059+
linker_flags: '-D CMAKE_EXE_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_EXE_LINKER_FLAGS }}" -D CMAKE_SHARED_LINKER_FLAGS="${{ inputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}" -D CMAKE_STATIC_LIBRARY_PREFIX_Swift=lib'
20592060
extra_flags:
20602061

20612062
- arch: arm64
@@ -2745,6 +2746,7 @@ jobs:
27452746
-D CMAKE_Swift_COMPILER_WORKS=YES `
27462747
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
27472748
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2749+
${{ matrix.cmake_linker_flags }} `
27482750
-D CMAKE_SYSTEM_NAME=Windows `
27492751
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
27502752
-G Ninja `
@@ -2774,6 +2776,7 @@ jobs:
27742776
-D CMAKE_Swift_COMPILER_WORKS=YES `
27752777
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
27762778
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2779+
${{ matrix.cmake_linker_flags }} `
27772780
-D CMAKE_SYSTEM_NAME=Windows `
27782781
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
27792782
-G Ninja `
@@ -2802,6 +2805,7 @@ jobs:
28022805
-D CMAKE_Swift_COMPILER_WORKS=YES `
28032806
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28042807
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2808+
${{ matrix.cmake_linker_flags }} `
28052809
-D CMAKE_SYSTEM_NAME=Windows `
28062810
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
28072811
-G Ninja `
@@ -2830,6 +2834,7 @@ jobs:
28302834
-D CMAKE_Swift_COMPILER_WORKS=YES `
28312835
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28322836
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2837+
${{ matrix.cmake_linker_flags }} `
28332838
-D CMAKE_SYSTEM_NAME=Windows `
28342839
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
28352840
-G Ninja `
@@ -2862,6 +2867,7 @@ jobs:
28622867
-D CMAKE_Swift_COMPILER_WORKS=YES `
28632868
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28642869
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2870+
${{ matrix.cmake_linker_flags }} `
28652871
-D CMAKE_SYSTEM_NAME=Windows `
28662872
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
28672873
-G Ninja `
@@ -2891,6 +2897,7 @@ jobs:
28912897
-D CMAKE_Swift_COMPILER_WORKS=YES `
28922898
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
28932899
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2900+
${{ matrix.cmake_linker_flags }} `
28942901
-D CMAKE_SYSTEM_NAME=Windows `
28952902
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
28962903
-G Ninja `
@@ -2923,6 +2930,7 @@ jobs:
29232930
-D CMAKE_Swift_COMPILER_WORKS=YES `
29242931
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
29252932
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2933+
${{ matrix.cmake_linker_flags }} `
29262934
-D CMAKE_SYSTEM_NAME=Windows `
29272935
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
29282936
-G Ninja `
@@ -2950,6 +2958,7 @@ jobs:
29502958
-D CMAKE_Swift_COMPILER_WORKS=YES `
29512959
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
29522960
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2961+
${{ matrix.cmake_linker_flags }} `
29532962
-D CMAKE_SYSTEM_NAME=Windows `
29542963
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
29552964
-G Ninja `
@@ -2971,6 +2980,7 @@ jobs:
29712980
-D CMAKE_Swift_COMPILER_WORKS=YES `
29722981
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
29732982
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
2983+
${{ matrix.cmake_linker_flags }} `
29742984
-D CMAKE_SYSTEM_NAME=Windows `
29752985
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
29762986
-G Ninja `
@@ -3008,6 +3018,7 @@ jobs:
30083018
-D CMAKE_Swift_COMPILER_WORKS=YES `
30093019
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
30103020
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3021+
${{ matrix.cmake_linker_flags }} `
30113022
-D CMAKE_SYSTEM_NAME=Windows `
30123023
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
30133024
-G Ninja `
@@ -3048,6 +3059,7 @@ jobs:
30483059
-D CMAKE_Swift_COMPILER_WORKS=YES `
30493060
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
30503061
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3062+
${{ matrix.cmake_linker_flags }} `
30513063
-D CMAKE_SYSTEM_NAME=Windows `
30523064
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
30533065
-G Ninja `
@@ -3075,6 +3087,7 @@ jobs:
30753087
-D CMAKE_Swift_COMPILER_WORKS=YES `
30763088
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
30773089
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3090+
${{ matrix.cmake_linker_flags }} `
30783091
-D CMAKE_SYSTEM_NAME=Windows `
30793092
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
30803093
-G Ninja `
@@ -3099,6 +3112,7 @@ jobs:
30993112
-D CMAKE_C_COMPILER=${CLANG_CL} `
31003113
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
31013114
-D CMAKE_C_FLAGS="${{ inputs.WINDOWS_CMAKE_C_FLAGS }}" `
3115+
${{ matrix.cmake_linker_flags }} `
31023116
-D CMAKE_SYSTEM_NAME=Windows `
31033117
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
31043118
-G Ninja `
@@ -3128,6 +3142,7 @@ jobs:
31283142
-D CMAKE_Swift_COMPILER_WORKS=YES `
31293143
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
31303144
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3145+
${{ matrix.cmake_linker_flags }} `
31313146
-D CMAKE_SYSTEM_NAME=Windows `
31323147
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
31333148
-G Ninja `
@@ -3158,6 +3173,7 @@ jobs:
31583173
-D CMAKE_Swift_COMPILER_WORKS=YES `
31593174
-D CMAKE_Swift_FLAGS="-sdk ${env:SDKROOT} ${{ inputs.CMAKE_Swift_FLAGS }}" `
31603175
-D CMAKE_Swift_FLAGS_RELEASE="-O" `
3176+
${{ matrix.cmake_linker_flags }} `
31613177
-D CMAKE_SYSTEM_NAME=Windows `
31623178
-D CMAKE_SYSTEM_PROCESSOR=${{ matrix.cpu }} `
31633179
-G Ninja `

0 commit comments

Comments
 (0)