Skip to content

Commit 6c1096d

Browse files
committed
Make vanilla C++17 (with exceptions and RTTI) the default
1 parent fb31a7e commit 6c1096d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

commands/init

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ EOF
1515
exit 1
1616
fi
1717

18+
if [ -n "$TRAVIS_BRANCH" ]; then
19+
CLI_BRANCH="$TRAVIS_BRANCH"
20+
else
21+
CLI_BRANCH=$(git -C "${BASH_SOURCE%/*}" rev-parse --abbrev-ref HEAD)
22+
fi
23+
24+
BOILERPLATE_URL="https://github.com/cppsm/cppsm-boilerplate.git"
25+
1826
if [ ! -d .cppsm ]; then
19-
git submodule "${GIT_QUIET[@]}" add --branch master https://github.com/cppsm/cppsm-boilerplate.git .cppsm
27+
if git ls-remote --heads "$BOILERPLATE_URL" | grep -q "\brefs/heads/$CLI_BRANCH\$"; then
28+
BOILERPLATE_BRANCH="$CLI_BRANCH"
29+
else
30+
BOILERPLATE_BRANCH="master"
31+
fi
32+
git submodule "${GIT_QUIET[@]}" add --branch "$BOILERPLATE_BRANCH" "$BOILERPLATE_URL" .cppsm
2033
fi
2134

2235
ln -fs .cppsm/.clang-format .clang-format
@@ -27,7 +40,7 @@ if [ ! -e CMakeLists.txt ]; then
2740
cat << EOF > CMakeLists.txt
2841
cmake_minimum_required(VERSION 3.9)
2942
project(${PWD##*/})
30-
include(.cppsm/c++17-no-rtti-no-exns.cmake)
43+
include(.cppsm/c++17.cmake)
3144
EOF
3245
fi
3346

0 commit comments

Comments
 (0)