Custom AU discovery code
[carla.git] / .github / workflows / cmake.yml
blobf9d20b793b7cf5fefa6fb09cb2c146ec6a57981a
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:20.04
16           - container: ubuntu:22.04
17           - container: ubuntu:23.10
18     runs-on: ubuntu-latest
19     container:
20       image: ${{ matrix.container }}
21     steps:
22       - uses: actions/checkout@v3
23       - name: Set up dependencies
24         run: |
25           apt-get update -qq
26           apt-get install -yqq cmake g++ libfluidsynth-dev liblo-dev libmagic-dev libsndfile1-dev libx11-dev lsb-release pkg-config
27           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
28       - name: configure
29         run: cmake -S cmake -B build
30       - name: build
31         run: cmake --build build -j $(nproc)
32       - name: install
33         run: cmake --install build --verbose
34       - uses: actions/upload-artifact@v3
35         with:
36           name: linux-${{ env.PACK_NAME }}
37           path: ${{ env.DESTDIR }}
39   macos:
40     strategy:
41       matrix:
42         include:
43           - frameworks: ON
44           - frameworks: OFF
45     runs-on: macos-latest
46     steps:
47       - uses: actions/checkout@v3
48       - name: Set up dependencies
49         run: |
50           brew install cmake fluid-synth liblo libmagic libsndfile pkg-config
51           if [ "${{ matrix.frameworks }}" = "" ]; then
52             echo "PACK_NAME=frameworks" >> "${GITHUB_ENV}"
53           else
54             echo "PACK_NAME=libs" >> "${GITHUB_ENV}"
55           fi
56       - name: configure
57         run: cmake -S cmake -B build -DCARLA_BUILD_FRAMEWORKS=${{ matrix.frameworks }}
58       - name: build
59         run: cmake --build build -j $(sysctl -n hw.logicalcpu)
60       - name: install
61         run: cmake --install build --verbose
62       - uses: actions/upload-artifact@v3
63         with:
64           name: macos-${{ env.PACK_NAME }}
65           path: ${{ env.DESTDIR }}
67   mingw32-cross:
68     strategy:
69       matrix:
70         include:
71           - container: debian:11
72           - container: debian:12
73           #- container: ubuntu:20.04
74           - container: ubuntu:22.04
75           - container: ubuntu:23.10
76     runs-on: ubuntu-latest
77     container:
78       image: ${{ matrix.container }}
79     steps:
80       - uses: actions/checkout@v3
81       - name: Set up dependencies
82         run: |
83           dpkg --add-architecture i386
84           apt-get update -qq
85           apt-get install -yqq cmake binutils-mingw-w64-i686 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config
86           if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then
87               apt-get install -yqq wine wine32 wine64
88           else
89               apt-get install -yqq wine-stable
90           fi
91           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
92       - name: configure
93         env:
94           PKG_CONFIG: false
95         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
96       - name: build
97         run: cmake --build build -j $(nproc)
98       - name: install
99         run: cmake --install build --verbose
100       - uses: actions/upload-artifact@v3
101         with:
102           name: mingw32-${{ env.PACK_NAME }}
103           path: ${{ env.DESTDIR }}
105   mingw64-cross:
106     strategy:
107       matrix:
108         include:
109           - container: debian:11
110           - container: debian:12
111           #- container: ubuntu:20.04
112           - container: ubuntu:22.04
113           - container: ubuntu:23.10
114     runs-on: ubuntu-latest
115     container:
116       image: ${{ matrix.container }}
117     steps:
118       - uses: actions/checkout@v3
119       - name: Set up dependencies
120         run: |
121           dpkg --add-architecture i386
122           apt-get update -qq
123           apt-get install -yqq cmake binutils-mingw-w64-x86-64 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config
124           if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then
125               apt-get install -yqq wine wine32 wine64
126           else
127               apt-get install -yqq wine-stable
128           fi
129           echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}"
130       - name: configure
131         env:
132           PKG_CONFIG: false
133         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
134       - name: build
135         run: cmake --build build -j $(nproc)
136       - name: install
137         run: cmake --install build --verbose
138       - uses: actions/upload-artifact@v3
139         with:
140           name: mingw64-${{ env.PACK_NAME }}
141           path: ${{ env.DESTDIR }}
143   windows:
144     runs-on: windows-latest
145     steps:
146       - uses: actions/checkout@v3
147       - name: configure
148         run: cmake -S cmake -B build
149       - name: build
150         run: cmake --build build
151       # FIXME fails with error
152       # https://github.com/falkTX/Carla/actions/runs/5137608233/jobs/9245932221
153       #- name: install
154         #run: cmake --install build --verbose