Skip to content

Commit 29c5eb6

Browse files
chore(build): set up for compiling on different compilers
Used for internal testing.
1 parent 1a2568b commit 29c5eb6

File tree

3 files changed

+48
-22
lines changed

3 files changed

+48
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ CMakeFiles
33
Makefile
44
bin
55
cmake_install.cmake
6-
6+
builds/
77
tags

cross_compile.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
function build_for {
4+
CC=$1
5+
CXX=$2
6+
BUILD_DIR=build-$CC
7+
8+
mkdir $BUILD_DIR
9+
pushd $BUILD_DIR
10+
CC=$CC CXX=$CXX cmake ../..
11+
make
12+
popd
13+
}
14+
15+
if [[ -d builds ]]; then
16+
rm -rf builds
17+
fi
18+
19+
mkdir builds
20+
pushd builds
21+
22+
build_for gcc-4.5 g++-4.5
23+
GCC45=$?
24+
25+
build_for gcc-4.6 g++-4.6
26+
GCC46=$?
27+
28+
build_for gcc-4.7 g++-4.7
29+
GCC47=$?
30+
31+
build_for gcc-4.8 g++-4.8
32+
GCC48=$?
33+
34+
build_for clang clang++
35+
CLANG=$?
36+
37+
popd
38+
39+
echo
40+
echo "Result:"
41+
echo -e "gcc-4.5:\t$GCC45"
42+
echo -e "gcc-4.6:\t$GCC46"
43+
echo -e "gcc-4.7:\t$GCC47"
44+
echo -e "gcc-4.8:\t$GCC48"
45+
echo -e "clang:\t$CLANG"
46+
echo "Done"
47+
exit $(( $GCC45 + $GCC46 + $GCC47 + $GCC48 + $CLANG ))

init_cmake.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)