Revise gresources use
[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 rm -r build > /dev/null 2>&1
32 meson setup build > /dev/null 2>&1
33
34 printf '\e[32m%s\n' "$compiler all disabled"
35 meson configure --auto-features disabled build
36
37 if (! ninja -C build clean > /dev/null 2>&1)
38 then
39         echo "ERROR"
40 fi
41 if (! ninja -C build > /dev/null 2>&1)
42 then
43         echo "ERROR"
44 fi
45
46 printf '\e[32m%s\n' "$compiler none disabled"
47 meson configure --auto-features auto build
48
49 if (! ninja -C build clean > /dev/null 2>&1)
50 then
51         echo "ERROR"
52 fi
53 if (! ninja -C build > /dev/null 2>&1)
54 then
55         echo "ERROR"
56 fi
57 }
58
59 export CC=clang
60 export CXX=clang++
61 compile "clang"
62
63 export CC=
64 export CXX=
65 compile "gcc"