-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·47 lines (43 loc) · 1.18 KB
/
configure
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
41
42
43
44
45
46
47
#!/bin/sh
CXXFLAGS="-std=c++14 -Wall -Werror -Wextra -pedantic"
BUILD_TYPE=Release
usage() {
cat << EOF
$0
--with-debug Add debug flags
--with-coverage Add coverage flags
--with-clang Compile with clang
--with-optimizations Compile with optimizations flags (-O3)
--help Display this message
EOF
}
for arg in "$@"
do
case "$arg" in
--with-debug)
CXXFLAGS="$CXXFLAGS -O0 -g3 -gdwarf-2"
BUILD_TYPE=Debug
;;
--with-coverage)
CXXFLAGS="$CXXFLAGS -O0 -g3 -pg -fprofile-arcs -ftest-coverage"
BUILD_TYPE=Debug
COVERAGE="set(COVERAGE yes)"
;;
--with-optimizations)
CXXFLAGS="$CFLAGS -O3 -march=native"
;;
--with-clang)
CLANG="set(CMAKE_CXX_COMPILER clang++)"
;;
--with-gcc)
CLANG="set(CMAKE_CXX_COMPILER g++)"
;;
--help)
usage
;;
esac
done
echo "set(CMAKE_CXX_FLAGS \"$CXXFLAGS\")" > common.cmake
echo "set(CMAKE_BUILD_TYPE $BUILD_TYPE)" >> common.cmake
echo $COVERAGE >> common.cmake
echo $CLANG >> common.cmake