Fix #1004, 1005: Various meson problems
[geeqie.git] / scripts / check-compiles.sh
1 #!/bin/sh
2
3 #/*
4 # * Copyright (C) 2022 The Geeqie Team
5 # *
6 # * Author: Colin Clark  
7 # *  
8 # * This program is free software; you can redistribute it and/or modify
9 # * it under the terms of the GNU General Public License as published by
10 # * the Free Software Foundation; either version 2 of the License, or
11 # * (at your option) any later version.
12 # *
13 # * This program is distributed in the hope that it will be useful,
14 # * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # * GNU General Public License for more details.
17 # *
18 # * You should have received a copy of the GNU General Public License along
19 # * with this program; if not, write to the Free Software Foundation, Inc.,
20 # * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 # */
22
23 ## @file
24 ## @brief Check that Geeqie compiles with both gcc and clang,
25 ## for GTK3, and with and without optional modules.
26 ## 
27
28 compile()
29 {
30 compiler="$1"
31
32 printf '\e[32m%s\n' "$compiler all disabled"
33 meson configure build -Darchive=disabled -Dcms=disabled -Ddjvu=disabled -Dexiv2=disabled -Dvideothumbnailer=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dtiff=disabled -Dwebp=disabled
34
35 if (! ninja -C build clean > /dev/null 2>&1)
36 then
37         echo "ERROR"
38 fi
39 if (! ninja -C build > /dev/null 2>&1)
40 then
41         echo "ERROR"
42 fi
43
44 printf '\e[32m%s\n' "$compiler none disabled"
45 meson configure build -Darchive=auto -Dcms=auto -Ddjvu=auto -Dexiv2=auto -Dvideothumbnailer=auto -Dgps-map=auto -Dheif=auto -Dj2k=auto -Djpeg=auto -Djpegxl=auto -Dlibraw=auto -Dlua=auto -Dpdf=auto -Dspell=auto -Dtiff=auto -Dwebp=auto
46
47 if (! ninja -C build clean > /dev/null 2>&1)
48 then
49         echo "ERROR"
50 fi
51 if (! ninja -C build > /dev/null 2>&1)
52 then
53         echo "ERROR"
54 fi
55 }
56
57 export CC=clang
58 export CXX=clang++
59 compile "clang"
60
61 export CC=
62 export CXX=
63 compile "gcc"