Skip to content

Commit

Permalink
use -O2 and add arm64 build (#2745)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel-hrvs authored Mar 1, 2025
1 parent da8e5b9 commit dccb45a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 26 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
cmake --build . --config MinSizeRel --parallel
# === Ubuntu gcc14 ===
linux-gcc14-glibc239:
runs-on: ubuntu-24.04
# === Ubuntu-arm64 ===
linux-arm64-gcc12-glibc235:
runs-on: ubuntu-22.04-arm

steps:
- uses: actions/checkout@v4
Expand All @@ -172,11 +172,10 @@ jobs:

- name: Install
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt update
sudo apt-get install gcc-14 g++-14 libxext-dev libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
sudo ln -s -f /usr/bin/gcc-14 /usr/bin/gcc
sudo ln -s -f /usr/bin/g++-14 /usr/bin/g++
sudo apt-get update
sudo apt-get install gcc-12 g++-12 libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
sudo ln -s -f /usr/bin/gcc-12 /usr/bin/gcc
sudo ln -s -f /usr/bin/g++-12 /usr/bin/g++
- name: Build
run: |
Expand All @@ -187,7 +186,7 @@ jobs:
- name: Deploy
uses: actions/upload-artifact@v4
with:
name: "tic80-linux-gcc14"
name: "tic80-linux-arm64-gcc12"
path: |
build/bin/tic80
build/bin/*.so
Expand All @@ -198,40 +197,46 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
cmake --build . --config MinSizeRel --parallel
# === Raspberry PI ===
rpi:
runs-on: ubuntu-latest
container: nesbox/rpi-tic80:latest
# === Ubuntu gcc14 ===
linux-gcc14-glibc239:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install Host toolchain
run: |
apt-get update
apt-get install --assume-yes build-essential ruby-full gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- name: Install
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt update
sudo apt-get install gcc-14 g++-14 libxext-dev libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
sudo ln -s -f /usr/bin/gcc-14 /usr/bin/gcc
sudo ln -s -f /usr/bin/g++-14 /usr/bin/g++
- name: Build
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=rpi/toolchain.cmake -DBUILD_WITH_ALL=ON ..
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_STATIC=ON -DBUILD_WITH_ALL=ON ..
cmake --build . --parallel
- name: Deploy
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "tic80-rpi"
name: "tic80-linux-gcc14"
path: |
build/bin/tic80
build/bin/*.so
- name: Build Pro
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_PRO=On -DCMAKE_TOOLCHAIN_FILE=rpi/toolchain.cmake ..
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
cmake --build . --config MinSizeRel --parallel
# === Raspberry PI 1-4 Bare Metal ===
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ include(cmake/version.cmake)
project(TIC-80 VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION} LANGUAGES C CXX)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -flto -ffat-lto-objects")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto -ffat-lto-objects")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -flto -ffat-lto-objects")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -flto -ffat-lto-objects")
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -flto")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -flto")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -flto")
endif()

if(APPLE)
Expand Down

0 comments on commit dccb45a

Please sign in to comment.