maint: use clang (#21)
This commit is contained in:
parent
81704a19db
commit
b80aa01f2b
36
.github/workflows/build.yml
vendored
36
.github/workflows/build.yml
vendored
@ -21,7 +21,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
arch:
|
||||
- x64
|
||||
@ -69,14 +68,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
arch:
|
||||
- x64
|
||||
- arm64
|
||||
include:
|
||||
- configuration: Debug
|
||||
config: debug
|
||||
- configuration: Release
|
||||
config: release
|
||||
steps:
|
||||
@ -92,13 +88,13 @@ jobs:
|
||||
if: matrix.arch == 'x64'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libcurl4-gnutls-dev
|
||||
sudo apt-get install libcurl4-gnutls-dev -y
|
||||
|
||||
- name: Install cross build tools (arm64)
|
||||
- name: Install crossbuild tools (arm64)
|
||||
if: matrix.arch == 'arm64'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install crossbuild-essential-arm64
|
||||
sudo apt-get install crossbuild-essential-arm64 -y
|
||||
|
||||
- name: Install dependencies (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
|
||||
sudo dpkg --add-architecture arm64
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install libcurl4-gnutls-dev:arm64
|
||||
|
||||
- name: Install Mold
|
||||
uses: rui314/setup-mold@staging
|
||||
sudo apt-get install libcurl4-gnutls-dev:arm64 -y
|
||||
|
||||
- name: Install Premake5
|
||||
uses: abel0b/setup-premake@v2.2
|
||||
@ -125,20 +118,13 @@ jobs:
|
||||
- name: Set up problem matching
|
||||
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
|
||||
run: |
|
||||
pushd build
|
||||
make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc)
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
|
||||
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
@ -147,24 +133,24 @@ jobs:
|
||||
path: |
|
||||
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master
|
||||
|
||||
build-mac:
|
||||
build-macos:
|
||||
name: Build macOS
|
||||
runs-on: macos-13
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
arch:
|
||||
- x64
|
||||
- arm64
|
||||
include:
|
||||
- configuration: Debug
|
||||
config: debug
|
||||
- configuration: Release
|
||||
config: release
|
||||
- arch: x64
|
||||
platform: x64
|
||||
- arch: arm64
|
||||
platform: arm64
|
||||
steps:
|
||||
- name: Check out files
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
8
deps/premake/libtomcrypt.lua
vendored
8
deps/premake/libtomcrypt.lua
vendored
@ -54,7 +54,13 @@ function libtomcrypt.project()
|
||||
}
|
||||
|
||||
if os.istarget("darwin") then
|
||||
buildoptions "-march=native"
|
||||
filter "platforms:x64"
|
||||
buildoptions "-march=native"
|
||||
filter {}
|
||||
|
||||
filter "platforms:arm64"
|
||||
buildoptions "-mcpu=apple-m1"
|
||||
filter {}
|
||||
end
|
||||
|
||||
warnings "Off"
|
||||
|
20
premake5.lua
20
premake5.lua
@ -39,7 +39,7 @@ targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
|
||||
configurations {"Debug", "Release"}
|
||||
|
||||
if os.istarget("darwin") then
|
||||
platforms {"x64"}
|
||||
platforms {"x64", "arm64"}
|
||||
else
|
||||
platforms {"x86", "x64", "arm64"}
|
||||
end
|
||||
@ -76,11 +76,25 @@ editandcontinue "Off"
|
||||
warnings "Extra"
|
||||
characterset "ASCII"
|
||||
|
||||
if os.istarget("linux") or os.istarget("darwin") then
|
||||
filter { "system:linux", "system:macosx" }
|
||||
buildoptions "-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
|
||||
|
||||
filter { "system:macosx", "platforms:arm64" }
|
||||
buildoptions "-arch arm64"
|
||||
linkoptions "-arch arm64"
|
||||
filter {}
|
||||
|
||||
if _OPTIONS["dev-build"] then
|
||||
defines {"DEV_BUILD"}
|
||||
end
|
||||
@ -94,7 +108,7 @@ flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64Bi
|
||||
filter "configurations:Release"
|
||||
optimize "Speed"
|
||||
defines {"NDEBUG"}
|
||||
flags {"FatalCompileWarnings"}
|
||||
flags "FatalCompileWarnings"
|
||||
filter {}
|
||||
|
||||
filter "configurations:Debug"
|
||||
|
Loading…
Reference in New Issue
Block a user