diff options
Diffstat (limited to '.travis/flags.sh')
-rw-r--r-- | .travis/flags.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/.travis/flags.sh b/.travis/flags.sh new file mode 100644 index 00000000..0c80e703 --- /dev/null +++ b/.travis/flags.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | add_config_flag() { CONFIG_FLAGS="$CONFIG_FLAGS $@"; } | ||
4 | add_c_flag() { C_FLAGS="$C_FLAGS $@"; } | ||
5 | add_cxx_flag() { CXX_FLAGS="$CXX_FLAGS $@"; } | ||
6 | add_ld_flag() { LD_FLAGS="$LD_FLAGS $@"; } | ||
7 | add_flag() { add_c_flag "$@"; add_cxx_flag "$@"; } | ||
8 | |||
9 | export LD_LIBRARY_PATH="$CACHEDIR/lib" | ||
10 | export PKG_CONFIG_PATH="$CACHEDIR/lib/pkgconfig" | ||
11 | |||
12 | # Our own flags which we can insert in the correct place. We don't use CFLAGS | ||
13 | # and friends here (we unset them below), because they influence config tests | ||
14 | # such as ./configure and cmake tests. Our warning flags break those tests, so | ||
15 | # we can't add them globally here. | ||
16 | CONFIG_FLAGS="" | ||
17 | C_FLAGS="" | ||
18 | CXX_FLAGS="" | ||
19 | LD_FLAGS="" | ||
20 | |||
21 | unset CFLAGS | ||
22 | unset CXXFLAGS | ||
23 | unset CPPFLAGS | ||
24 | unset LDFLAGS | ||
25 | |||
26 | # Optimisation flags. | ||
27 | add_flag -O3 -march=native | ||
28 | |||
29 | # Warn on non-ISO C. | ||
30 | add_c_flag -pedantic | ||
31 | |||
32 | add_flag -g3 | ||
33 | add_flag -ftrapv | ||