-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
40 lines (36 loc) · 1.17 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
os:
- linux
matrix:
include:
- dist: jammy
compiler: gcc
- dist: jammy
compiler: clang
- dist: focal
compiler: gcc
- dist: focal
compiler: clang
language: c
install:
# powercap dependency
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
git clone https://github.com/powercap/powercap.git libpowercap
mkdir libpowercap/_build
cd libpowercap/_build
cmake -DCMAKE_INSTALL_PREFIX=_install ..
cmake --build . --target install
cd -
fi
script:
- mkdir _build
- cd _build
# Test build with stricter flags
- export CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector -g3 -pedantic -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Wdisabled-optimization -Wendif-labels -Wfloat-conversion -Wfloat-equal -Wformat=2 -Wformat-nonliteral
-Winline -Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow
-Wsign-conversion -Wstrict-prototypes -Wstack-protector -Wundef -Wwrite-strings
-Werror"
- cmake .. -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_PREFIX_PATH="$(pwd)/../libpowercap/_build/_install/"
- cmake --build .
- ctest --verbose