diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ff47c8..a88dace 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,7 @@ jobs: $CHROOT sudo add-apt-repository ppa:savoury1/build-tools $CHROOT sudo add-apt-repository ppa:ubuntu-toolchain-r/test $CHROOT sudo apt-get update - DEBIAN_FRONTEND=noninteractive $CHROOT sudo apt-get -y --no-install-recommends install libgl-dev libasound2-dev libpulse-dev curl nasm meson ninja-build libffi-dev gcc-11 g++-11 - $CHROOT sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 + DEBIAN_FRONTEND=noninteractive $CHROOT sudo apt-get -y --no-install-recommends install libgl-dev libasound2-dev libpulse-dev curl nasm meson ninja-build libffi-dev - name: Build zlib run: | diff --git a/platforms/Linux.sh b/platforms/Linux.sh index daee1f3..2ecdeaa 100755 --- a/platforms/Linux.sh +++ b/platforms/Linux.sh @@ -1,3 +1,11 @@ #!/bin/bash +sudo update-alternatives --remove-all gcc +sudo update-alternatives --remove-all g++ +sudo update-alternatives --remove-all gcov + +GCC_VERSION=14.1.0 +curl -L "https://github.com/legacyclonk/gcc-build/releases/download/$GCC_VERSION/gcc-$GCC_VERSION.tar.zst" | sudo tar -x --zstd -C / + +echo "CMAKE_CONFIGURE_ARGS=$CMAKE_CONFIGURE_ARGS -DCMAKE_TOOLCHAIN_FILE=$PWD/platforms/gcc14_20.04.cmake" >> $GITHUB_ENV echo "MAKE_CMD=make -j$(nproc)" >> $GITHUB_ENV echo "MESON_CONFIGURE_ARGS=-Ddefault_library=static" >> $GITHUB_ENV diff --git a/platforms/Mac.sh b/platforms/Mac.sh index 1bf57b2..d81f708 100755 --- a/platforms/Mac.sh +++ b/platforms/Mac.sh @@ -1,5 +1,10 @@ #!/bin/bash -echo "CMAKE_CONFIGURE_ARGS=$CMAKE_CONFIGURE_ARGS -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV +export HOMEBREW_NO_INSTALL_CLEANUP=1 +export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 +brew update +brew install llvm@18 ninja + +echo "CMAKE_CONFIGURE_ARGS=$CMAKE_CONFIGURE_ARGS -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_TOOLCHAIN_FILE=$PWD/platforms/clang16_mac.cmake" >> $GITHUB_ENV echo "MAKE_CMD=make -j$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV echo "LINK_FLAGS=-mmacosx-version-min=10.9" >> $GITHUB_ENV echo "C_XX_FLAGS=-mmacosx-version-min=10.9" >> $GITHUB_ENV diff --git a/platforms/clang16_mac.cmake b/platforms/clang16_mac.cmake new file mode 100644 index 0000000..d207acc --- /dev/null +++ b/platforms/clang16_mac.cmake @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.20) +set(CMAKE_C_COMPILER "/usr/local/opt/llvm/bin/clang") +set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++") + +set(CMAKE_C_FLAGS_INIT "-fexperimental-library -Wno-parentheses") +set(CMAKE_CXX_FLAGS_INIT "-stdlib=libc++ {CMAKE_C_FLAGS_INIT}") +set(CMAKE_OBJCXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT}") + +set(CMAKE_EXE_LINKER_FLAGS_INIT "-L/usr/local/opt/llvm/lib/c++") +set(CMAKE_SHARED_LINKER_FLAGS_INIT "-L/usr/local/opt/llvm/lib/c++") diff --git a/platforms/gcc14_20.04.cmake b/platforms/gcc14_20.04.cmake new file mode 100644 index 0000000..e7c15a6 --- /dev/null +++ b/platforms/gcc14_20.04.cmake @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.20) +set(CMAKE_C_COMPILER x86_64-linux-gnu-x86_64-linux-gnu-gcc-14) +set(CMAKE_CXX_COMPILER x86_64-linux-gnu-x86_64-linux-gnu-g++-14) + +set(CMAKE_C_FLAGS_INIT "-static-libgcc") +set(CMAKE_CXX_FLAGS_INIT "-static-libgcc -static-libstdc++") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-static-libgcc -static-libstdc++")