mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 09:49:19 +02:00
build with clang
Linux CI switches to clang 22; fixes what that exposed - export on out-of-line member definitions, missing std includes, missing glm imports. GCC 16 still builds.
This commit is contained in:
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@@ -37,12 +37,21 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
build-essential gcc-14 g++-14 ninja-build \
|
||||
build-essential ninja-build wget lsb-release software-properties-common gnupg \
|
||||
libgl1-mesa-dev libglew-dev libglfw3-dev \
|
||||
libpng-dev libopenal-dev libluajit-5.1-dev \
|
||||
libserialport-dev libsndfile1-dev \
|
||||
xorg-dev libxkbcommon-dev libwayland-dev wayland-protocols
|
||||
|
||||
- name: Install LLVM/Clang 22
|
||||
run: |
|
||||
# Noble ships Clang 18, whose C++20 module support is not good enough
|
||||
# for this tree; apt.llvm.org has current releases.
|
||||
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
|
||||
chmod +x /tmp/llvm.sh
|
||||
sudo /tmp/llvm.sh 22
|
||||
sudo apt-get install -y clang-tools-22 # clang-scan-deps, needed to scan modules
|
||||
|
||||
- name: Build current OpenAL Soft
|
||||
run: |
|
||||
git clone --depth 1 --branch 1.24.2 https://github.com/kcat/openal-soft.git /tmp/openal-soft
|
||||
@@ -52,28 +61,19 @@ jobs:
|
||||
sudo cmake --install /tmp/openal-soft/build
|
||||
sudo ldconfig
|
||||
|
||||
# A little bit of magic for unbreaking GCC. Not an issue for Clang and MSVC.
|
||||
# Fix for specific hard-errors for a combo of: varargs and always_inline
|
||||
- name: Patch GLM for GCC
|
||||
run: |
|
||||
sed -i 's/GLM_FUNC_QUALIFIER std::string format(const char\* message, \.\.\.)/inline std::string format(const char* message, ...)/' \
|
||||
ref/glm/glm/gtx/string_cast.inl
|
||||
grep -n "std::string format(const char\* message" ref/glm/glm/gtx/string_cast.inl
|
||||
|
||||
- name: Install SonarQube Cloud Build Wrapper
|
||||
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0
|
||||
|
||||
- name: Configure (CMake)
|
||||
env:
|
||||
# C++20 named modules need GCC 14+; noble's default build-essential is GCC 13
|
||||
CC: gcc-14
|
||||
CXX: g++-14
|
||||
CC: clang-22
|
||||
CXX: clang++-22
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DWITH_BETTER_RENDERER=OFF \
|
||||
-DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DUSE_LTO=OFF \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-attributes -fno-inline-functions-called-once" \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-attributes" \
|
||||
-DPython3_EXECUTABLE="$(which python3)"
|
||||
|
||||
- name: Build under Build Wrapper
|
||||
|
||||
22
.github/workflows/build_bin.yml
vendored
22
.github/workflows/build_bin.yml
vendored
@@ -149,7 +149,7 @@ jobs:
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -y \
|
||||
build-essential gcc-14 g++-14 ninja-build \
|
||||
build-essential ninja-build wget lsb-release software-properties-common gnupg \
|
||||
libgl1-mesa-dev \
|
||||
libglew-dev \
|
||||
libglfw3-dev \
|
||||
@@ -163,6 +163,15 @@ jobs:
|
||||
libwayland-dev \
|
||||
wayland-protocols
|
||||
|
||||
- name: Install LLVM/Clang 22
|
||||
run: |
|
||||
# Noble ships Clang 18, whose C++20 module support is not good enough
|
||||
# for this tree; apt.llvm.org has current releases.
|
||||
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
|
||||
chmod +x /tmp/llvm.sh
|
||||
sudo /tmp/llvm.sh 22
|
||||
sudo apt-get install -y clang-tools-22 # clang-scan-deps, needed to scan modules
|
||||
|
||||
#
|
||||
# Existing MaSzyna CI already builds OpenAL Soft 1.24.2,
|
||||
# so retain that instead of relying only on Ubuntu's package.
|
||||
@@ -193,17 +202,16 @@ jobs:
|
||||
|
||||
- name: Show environment
|
||||
run: |
|
||||
gcc-14 --version
|
||||
g++-14 --version
|
||||
clang-22 --version
|
||||
clang-scan-deps-22 --version
|
||||
ninja --version
|
||||
cmake --version
|
||||
python --version
|
||||
|
||||
- name: Configure
|
||||
env:
|
||||
# C++20 named modules need GCC 14+; noble's default build-essential is GCC 13
|
||||
CC: gcc-14
|
||||
CXX: g++-14
|
||||
CC: clang-22
|
||||
CXX: clang++-22
|
||||
run: |
|
||||
cmake \
|
||||
-S . \
|
||||
@@ -215,7 +223,7 @@ jobs:
|
||||
-DWITH_OPENVR=OFF \
|
||||
-DUSE_LTO=OFF \
|
||||
-DPython3_EXECUTABLE="${{ steps.python.outputs.python-path }}" \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-attributes -fno-inline-functions-called-once"
|
||||
-DCMAKE_CXX_FLAGS="-Wno-attributes"
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user