maint: use clang (#21)

This commit is contained in:
Edo 2023-06-29 20:28:28 +02:00 committed by GitHub
parent 81704a19db
commit b80aa01f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 29 deletions

View File

@ -21,7 +21,6 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
configuration: configuration:
- Debug
- Release - Release
arch: arch:
- x64 - x64
@ -69,14 +68,11 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
configuration: configuration:
- Debug
- Release - Release
arch: arch:
- x64 - x64
- arm64 - arm64
include: include:
- configuration: Debug
config: debug
- configuration: Release - configuration: Release
config: release config: release
steps: steps:
@ -92,13 +88,13 @@ jobs:
if: matrix.arch == 'x64' if: matrix.arch == 'x64'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install libcurl4-gnutls-dev sudo apt-get install libcurl4-gnutls-dev -y
- name: Install crossbuild tools (arm64) - name: Install crossbuild tools (arm64)
if: matrix.arch == 'arm64' if: matrix.arch == 'arm64'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install crossbuild-essential-arm64 sudo apt-get install crossbuild-essential-arm64 -y
- name: Install dependencies (arm64) - name: Install dependencies (arm64)
if: matrix.arch == 'arm64' if: matrix.arch == 'arm64'
@ -109,10 +105,7 @@ jobs:
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main multiverse universe" | sudo tee -a /etc/apt/sources.list echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main multiverse universe" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture arm64 sudo dpkg --add-architecture arm64
sudo apt-get update sudo apt-get update
sudo apt-get -y install libcurl4-gnutls-dev:arm64 sudo apt-get install libcurl4-gnutls-dev:arm64 -y
- name: Install Mold
uses: rui314/setup-mold@staging
- name: Install Premake5 - name: Install Premake5
uses: abel0b/setup-premake@v2.2 uses: abel0b/setup-premake@v2.2
@ -125,20 +118,13 @@ jobs:
- name: Set up problem matching - name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master uses: ammaraskar/gcc-problem-matcher@master
- name: Set up CC environment variable
if: matrix.arch == 'arm64'
run: |
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Set up CXX environment variable
if: matrix.arch == 'arm64'
run: |
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries
run: | run: |
pushd build pushd build
make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc) make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc)
env:
CC: clang
CXX: clang++
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries
uses: actions/upload-artifact@v3.1.2 uses: actions/upload-artifact@v3.1.2
@ -147,24 +133,24 @@ jobs:
path: | path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master
build-mac: build-macos:
name: Build macOS name: Build macOS
runs-on: macos-13 runs-on: macos-13
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
configuration: configuration:
- Debug
- Release - Release
arch: arch:
- x64 - x64
- arm64
include: include:
- configuration: Debug
config: debug
- configuration: Release - configuration: Release
config: release config: release
- arch: x64 - arch: x64
platform: x64 platform: x64
- arch: arm64
platform: arm64
steps: steps:
- name: Check out files - name: Check out files
uses: actions/checkout@v3.5.3 uses: actions/checkout@v3.5.3

View File

@ -54,7 +54,13 @@ function libtomcrypt.project()
} }
if os.istarget("darwin") then if os.istarget("darwin") then
filter "platforms:x64"
buildoptions "-march=native" buildoptions "-march=native"
filter {}
filter "platforms:arm64"
buildoptions "-mcpu=apple-m1"
filter {}
end end
warnings "Off" warnings "Off"

View File

@ -39,7 +39,7 @@ targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
configurations {"Debug", "Release"} configurations {"Debug", "Release"}
if os.istarget("darwin") then if os.istarget("darwin") then
platforms {"x64"} platforms {"x64", "arm64"}
else else
platforms {"x86", "x64", "arm64"} platforms {"x86", "x64", "arm64"}
end end
@ -76,11 +76,25 @@ editandcontinue "Off"
warnings "Extra" warnings "Extra"
characterset "ASCII" characterset "ASCII"
if os.istarget("linux") or os.istarget("darwin") then filter { "system:linux", "system:macosx" }
buildoptions "-pthread" buildoptions "-pthread"
linkoptions "-pthread" linkoptions "-pthread"
filter {}
if os.istarget("linux") then
filter { "platforms:arm64" }
buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu"
filter {}
linkoptions "-fuse-ld=lld"
end end
filter { "system:macosx", "platforms:arm64" }
buildoptions "-arch arm64"
linkoptions "-arch arm64"
filter {}
if _OPTIONS["dev-build"] then if _OPTIONS["dev-build"] then
defines {"DEV_BUILD"} defines {"DEV_BUILD"}
end end
@ -94,7 +108,7 @@ flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64Bi
filter "configurations:Release" filter "configurations:Release"
optimize "Speed" optimize "Speed"
defines {"NDEBUG"} defines {"NDEBUG"}
flags {"FatalCompileWarnings"} flags "FatalCompileWarnings"
filter {} filter {}
filter "configurations:Debug" filter "configurations:Debug"