Use wine paths by default even if non-existent
[carla.git] / .github / workflows / cmake.yml
blobe42b541ba0be37726b49347efc96c0676e5b548d
1 name: cmake
3 on: [push, pull_request]
5 env:
6   DESTDIR: ${{ github.workspace }}/build/tmp
8 jobs:
9   linux:
10     strategy:
11       matrix:
12         include:
13           - container: debian:11
14           - container: debian:12
15           - container: ubuntu:22.04
16           - container: ubuntu:24.04
17     runs-on: ubuntu-latest
18     container:
19       image: ${{ matrix.container }}
20     steps:
21       - uses: actions/checkout@v4
22       - name: Set up dependencies
23         run: |
24           apt-get update -qq
25           apt-get install -yqq cmake g++ libfluidsynth-dev liblo-dev libmagic-dev libsndfile1-dev libx11-dev lsb-release pkg-config
26           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
27       - name: configure
28         run: cmake -S cmake -B build
29       - name: build
30         run: cmake --build build -j $(nproc)
31       - name: install
32         run: cmake --install build --verbose
33       - uses: actions/upload-artifact@v4
34         with:
35           name: linux-${{ env.PACK_NAME }}
36           path: ${{ env.DESTDIR }}
38   macos:
39     strategy:
40       matrix:
41         include:
42           - frameworks: ON
43           - frameworks: OFF
44     runs-on: macos-latest
45     steps:
46       - uses: actions/checkout@v4
47       - name: Set up dependencies
48         run: |
49           brew install cmake fluid-synth liblo libmagic libsndfile pkg-config
50           if [ "${{ matrix.frameworks }}" = "" ]; then
51             echo "PACK_NAME=frameworks" >> "${GITHUB_ENV}"
52           else
53             echo "PACK_NAME=libs" >> "${GITHUB_ENV}"
54           fi
55       - name: configure
56         run: cmake -S cmake -B build -DCARLA_BUILD_FRAMEWORKS=${{ matrix.frameworks }}
57       - name: build
58         run: cmake --build build -j $(sysctl -n hw.logicalcpu)
59       - name: install
60         run: cmake --install build --verbose
61       - uses: actions/upload-artifact@v4
62         with:
63           name: macos-${{ env.PACK_NAME }}-${{ matrix.frameworks }}
64           path: ${{ env.DESTDIR }}
66   mingw32-cross:
67     strategy:
68       matrix:
69         include:
70           - container: debian:11
71           - container: debian:12
72           - container: ubuntu:22.04
73           - container: ubuntu:24.04
74     runs-on: ubuntu-latest
75     container:
76       image: ${{ matrix.container }}
77     steps:
78       - uses: actions/checkout@v4
79       - name: Set up dependencies
80         run: |
81           dpkg --add-architecture i386
82           apt-get update -qq
83           apt-get install -yqq cmake binutils-mingw-w64-i686 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config
84           if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then
85               apt-get install -yqq wine wine32 wine64
86           else
87               apt-get install -yqq wine-stable
88           fi
89           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
90       - name: configure
91         env:
92           PKG_CONFIG: false
93         run: cmake -S cmake -B build -DCMAKE_CROSSCOMPILING=ON -DCMAKE_CROSSCOMPILING_EMULATOR=wine -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=i686 -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ -DCMAKE_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_C_COMPILER_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_CXX_COMPILER_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_C_COMPILER_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres
94       - name: build
95         run: cmake --build build -j $(nproc)
96       - name: install
97         run: cmake --install build --verbose
98       - uses: actions/upload-artifact@v4
99         with:
100           name: mingw32-${{ env.PACK_NAME }}
101           path: ${{ env.DESTDIR }}
103   mingw64-cross:
104     strategy:
105       matrix:
106         include:
107           - container: debian:11
108           - container: debian:12
109           - container: ubuntu:22.04
110           - container: ubuntu:24.04
111     runs-on: ubuntu-latest
112     container:
113       image: ${{ matrix.container }}
114     steps:
115       - uses: actions/checkout@v4
116       - name: Set up dependencies
117         run: |
118           dpkg --add-architecture i386
119           apt-get update -qq
120           apt-get install -yqq cmake binutils-mingw-w64-x86-64 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config
121           if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then
122               apt-get install -yqq wine wine32 wine64
123           else
124               apt-get install -yqq wine-stable
125           fi
126           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
127       - name: configure
128         env:
129           PKG_CONFIG: false
130         run: cmake -S cmake -B build -DCMAKE_CROSSCOMPILING=ON -DCMAKE_CROSSCOMPILING_EMULATOR=wine -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_C_COMPILER_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_CXX_COMPILER_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_C_COMPILER_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres
131       - name: build
132         run: cmake --build build -j $(nproc)
133       - name: install
134         run: cmake --install build --verbose
135       - uses: actions/upload-artifact@v4
136         with:
137           name: mingw64-${{ env.PACK_NAME }}
138           path: ${{ env.DESTDIR }}
140   windows:
141     runs-on: windows-latest
142     steps:
143       - uses: actions/checkout@v4
144       - name: configure
145         run: cmake -S cmake -B build
146       - name: build
147         run: cmake --build build
148       # FIXME fails with error
149       # https://github.com/falkTX/Carla/actions/runs/5137608233/jobs/9245932221
150       #- name: install
151         #run: cmake --install build --verbose