Skip to content

Commit 3243bb7

Browse files
committed
[Mac Build] Add compilers to the Mac Build
* Add custom upload/download actions for tarring artifacts before upload and after download to preserve permissions. * Add a preliminary step to export the context for the compiler configuration step. This makes it easier to debug the compiler configuration step by seeing the full command line invocation on the GHA page.
1 parent d80dfe0 commit 3243bb7

File tree

2 files changed

+215
-131
lines changed

2 files changed

+215
-131
lines changed

.github/workflows/build-toolchain.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ jobs:
142142
WINDOWS_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.WINDOWS_CMAKE_SHARED_LINKER_FLAGS }}
143143
DARWIN_CMAKE_C_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}
144144
DARWIN_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}
145+
DARWIN_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}
146+
DARWIN_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}
145147
ANDROID_CMAKE_C_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_C_FLAGS }}
146148
ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
147149
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
@@ -244,6 +246,8 @@ jobs:
244246
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Z7 /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
245247
echo DARWIN_CMAKE_C_FLAGS="-g" >> ${GITHUB_OUTPUT}
246248
echo DARWIN_CMAKE_CXX_FLAGS="-g" >> ${GITHUB_OUTPUT}
249+
echo DARWIN_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
250+
echo DARWIN_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
247251
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
248252
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections -g" >> ${GITHUB_OUTPUT}
249253
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="-incremental:no -debug -opt:ref -opt:icf" >> ${GITHUB_OUTPUT}
@@ -256,6 +260,8 @@ jobs:
256260
echo WINDOWS_CMAKE_CXX_FLAGS="/GS- /Gw /Gy /Oi /Oy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" >> ${GITHUB_OUTPUT}
257261
echo DARWIN_CMAKE_C_FLAGS="" >> ${GITHUB_OUTPUT}
258262
echo DARWIN_CMAKE_CXX_FLAGS="" >> ${GITHUB_OUTPUT}
263+
echo DARWIN_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
264+
echo DARWIN_CMAKE_SHARED_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
259265
echo ANDROID_CMAKE_C_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
260266
echo ANDROID_CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" >> ${GITHUB_OUTPUT}
261267
echo WINDOWS_CMAKE_EXE_LINKER_FLAGS="" >> ${GITHUB_OUTPUT}
@@ -306,24 +312,24 @@ jobs:
306312
"include": [
307313
{
308314
"arch": "amd64",
309-
"compiler_target": "x86_64-unknown-windows-msvc",
310315
"os": "Windows",
311316
"cc": "cl",
312317
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
313318
"cxx": "cl",
314319
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
315320
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
321+
"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 }}\"",
316322
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=AMD64 -D CMAKE_MT=mt"
317323
},
318324
{
319325
"arch": "arm64",
320-
"compiler_target": "aarch64-unknown-windows-msvc",
321326
"os": "Windows",
322327
"cc": "cl",
323328
"cflags": "${{ steps.context.outputs.WINDOWS_CMAKE_C_FLAGS }}",
324329
"cxx": "cl",
325330
"cxxflags": "${{ steps.context.outputs.WINDOWS_CMAKE_CXX_FLAGS }}",
326331
"swiftflags": "${{ steps.context.outputs.WINDOWS_CMAKE_Swift_FLAGS }}",
332+
"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 }}\"",
327333
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=ARM64 -D CMAKE_MT=mt"
328334
}
329335
]
@@ -423,25 +429,25 @@ jobs:
423429
"include": [
424430
{
425431
"arch": "x86_64",
426-
"compiler_target": "x86_64-apple-macosx10.15",
427432
"os": "Darwin",
428433
"cc": "clang",
429434
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
430435
"cxx": "clang++",
431436
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
432437
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
433-
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" -D CMAKE_OSX_ARCHITECTURES=x86_64"
438+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }}\" -D CMAKE_SHARED_LINKER_FLAGS=\"${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}\"",
439+
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=x86_64"
434440
},
435441
{
436442
"arch": "arm64",
437-
"compiler_target": "arm64-apple-macosx10.15",
438443
"os": "Darwin",
439444
"cc": "clang",
440445
"cflags": "${{ steps.context.outputs.DARWIN_CMAKE_C_FLAGS }}",
441446
"cxx": "clang++",
442447
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
443448
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
444-
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" -D CMAKE_OSX_ARCHITECTURES=arm64"
449+
"cmake_linker_flags": "-D CMAKE_EXE_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_EXE_LINKER_FLAGS }} -D CMAKE_SHARED_LINKER_FLAGS=${{ steps.context.outputs.DARWIN_CMAKE_SHARED_LINKER_FLAGS }}",
450+
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
445451
}
446452
]
447453
}
@@ -456,7 +462,7 @@ jobs:
456462
"cxx": "clang++",
457463
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
458464
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
459-
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" -D CMAKE_OSX_ARCHITECTURES=arm64"
465+
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
460466
}
461467
]
462468
}
@@ -471,7 +477,7 @@ jobs:
471477
"cxx": "clang++",
472478
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
473479
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
474-
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" -D CMAKE_OSX_ARCHITECTURES=x86_64"
480+
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=x86_64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=x86_64"
475481
},
476482
{
477483
"arch": "arm64",
@@ -481,7 +487,7 @@ jobs:
481487
"cxx": "clang++",
482488
"cxxflags": "${{ steps.context.outputs.DARWIN_CMAKE_CXX_FLAGS }}",
483489
"swiftflags": "${{ steps.context.outputs.DARWIN_CMAKE_Swift_FLAGS }}",
484-
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\" -D CMAKE_OSX_ARCHITECTURES=arm64"
490+
"extra_flags": "-D CMAKE_SYSTEM_PROCESSOR=arm64 -D CMAKE_OSX_DEPLOYMENT_TARGET=15.0 -D CMAKE_OSX_ARCHITECTURES=arm64"
485491
}
486492
]
487493
}
@@ -572,7 +578,7 @@ jobs:
572578
uses: ./.github/workflows/swift-toolchain.yml
573579
with:
574580
build_os: Darwin
575-
build_arch: aarch64
581+
build_arch: arm64
576582
build_matrix: ${{ needs.context.outputs.darwin_build_matrix }}
577583
host_matrix: ${{ needs.context.outputs.darwin_host_matrix }}
578584
target_matrix: ${{ needs.context.outputs.darwin_target_matrix }}

0 commit comments

Comments
 (0)