summaryrefslogtreecommitdiff
path: root/.travis/flags.sh
diff options
context:
space:
mode:
Diffstat (limited to '.travis/flags.sh')
-rw-r--r--.travis/flags.sh33
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
3add_config_flag() { CONFIG_FLAGS="$CONFIG_FLAGS $@"; }
4add_c_flag() { C_FLAGS="$C_FLAGS $@"; }
5add_cxx_flag() { CXX_FLAGS="$CXX_FLAGS $@"; }
6add_ld_flag() { LD_FLAGS="$LD_FLAGS $@"; }
7add_flag() { add_c_flag "$@"; add_cxx_flag "$@"; }
8
9export LD_LIBRARY_PATH="$CACHEDIR/lib"
10export 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.
16CONFIG_FLAGS=""
17C_FLAGS=""
18CXX_FLAGS=""
19LD_FLAGS=""
20
21unset CFLAGS
22unset CXXFLAGS
23unset CPPFLAGS
24unset LDFLAGS
25
26# Optimisation flags.
27add_flag -O3 -march=native
28
29# Warn on non-ISO C.
30add_c_flag -pedantic
31
32add_flag -g3
33add_flag -ftrapv