mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-27 19:19:35 +08:00
Check compiler version
This commit is contained in:
parent
8e59c0e0ac
commit
5d89f4f0e6
7
.github/workflows/build-on-Windows.yml
vendored
7
.github/workflows/build-on-Windows.yml
vendored
@ -51,7 +51,12 @@ jobs:
|
|||||||
|
|
||||||
- name: 为 Android 构建
|
- name: 为 Android 构建
|
||||||
run: |
|
run: |
|
||||||
mingw32-make.exe build-in-ci-release-mode CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android21-clang
|
compiler=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android21-clang
|
||||||
|
|
||||||
|
# 检查编译器版本
|
||||||
|
$compiler --version
|
||||||
|
|
||||||
|
mingw32-make.exe build-in-ci-release-mode CC=$compiler CROSS_BUILD_WINDOWS_FOR_ANDROID=1
|
||||||
mv chsrc-ci-release.exe chsrc-arm64-android
|
mv chsrc-ci-release.exe chsrc-arm64-android
|
||||||
|
|
||||||
- name: List files
|
- name: List files
|
||||||
|
12
.github/workflows/build-on-macOS.yml
vendored
12
.github/workflows/build-on-macOS.yml
vendored
@ -4,7 +4,7 @@
|
|||||||
# Contributors : Nul None <nul@none.org>
|
# Contributors : Nul None <nul@none.org>
|
||||||
# |
|
# |
|
||||||
# Created On : <2023-09-15>
|
# Created On : <2023-09-15>
|
||||||
# Last Modified : <2025-06-20>
|
# Last Modified : <2025-07-22>
|
||||||
#
|
#
|
||||||
# Build chsrc on macOS and upload it to GitHub: the 'pre' release
|
# Build chsrc on macOS and upload it to GitHub: the 'pre' release
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
@ -22,6 +22,11 @@ jobs:
|
|||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 检查编译器版本
|
||||||
|
run: |
|
||||||
|
clang --version
|
||||||
|
gcc --version
|
||||||
|
|
||||||
- name: 为 arm64 (AArch64) 构建
|
- name: 为 arm64 (AArch64) 构建
|
||||||
run: |
|
run: |
|
||||||
make build-in-ci-release-mode
|
make build-in-ci-release-mode
|
||||||
@ -47,6 +52,11 @@ jobs:
|
|||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 检查编译器版本
|
||||||
|
run: |
|
||||||
|
clang --version
|
||||||
|
gcc --version
|
||||||
|
|
||||||
- name: 为 x64 构建
|
- name: 为 x64 构建
|
||||||
run: |
|
run: |
|
||||||
make build-in-ci-release-mode
|
make build-in-ci-release-mode
|
||||||
|
12
Makefile
12
Makefile
@ -101,10 +101,14 @@ ifeq ($(MAKECMDGOALS), build-in-ci-release-mode)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(On-macOS), 1)
|
ifeq ($(On-macOS), 1)
|
||||||
# 太糟糕了,到现在 (2025-07-22) GitHub Actions 的 macOS (13、15) 中的 LLVM 版本还太低
|
ifeq ($(CC), clang)
|
||||||
# 我们代码里有 raw string literal 扩展的用法,所以只能切到 GCC 去
|
CFLAGS += -fraw-string-literals
|
||||||
# 但是用户自己编译等情况下,依旧让他们用 Clang,因为他们环境的 LLVM 版本可能比较新
|
endif
|
||||||
CC = gcc
|
endif
|
||||||
|
|
||||||
|
# 在 Windows 上交叉编译 Android 时,用的是 clang
|
||||||
|
ifdef CROSS_BUILD_WINDOWS_FOR_ANDROID
|
||||||
|
CFLAGS += -fraw-string-literals
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user