(Go: >> BACK << -|- >> HOME <<)

Skip to content

Commit

Permalink
update travis ci to use gcc and clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Laning committed May 30, 2020
1 parent 5c60d66 commit 02f1298
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
dist: bionic
sudo: require
language: cpp
compiler: gcc
compiler:
- gcc
- clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
# packages:
# - gcc-6
# - g++-6
- cmake-data
- cmake
script:
- sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
- sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
- gcc -v && g++ -v && cmake --version
# - sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
# - sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
- cmake --version
- CC=/usr/bin/gcc
- CXX=/usr/bin/g++
- $CC --version && $CXX --version
- mkdir build && cd build
- cmake ../
- make
- make test
- cd .. && rm -rf build/
- CC=/usr/bin/clang
- CXX=/usr/bin/clang++
- $CC --version && $CXX --version
- mkdir build && cd build
- cmake ../
- make
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ int main(int argc, const char* argv[]) {
case 2:
std::cout << "an even more verbose string" << std::endl;
// fall through
#ifdef __clang__
[[clang::fallthrough]];
#endif
case 1:
std::cout << "a verbose string" << std::endl;
// fall through
#ifdef __clang__
[[clang::fallthrough]];
#endif
default:
std::cout << "some verbosity" << std::endl;
}
Expand Down
4 changes: 4 additions & 0 deletions example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ int main(int argc, const char* argv[]) {
case 2:
std::cout << "an even more verbose string" << std::endl;
// fall through
#ifdef __clang__
[[clang::fallthrough]];
#endif
case 1:
std::cout << "a verbose string" << std::endl;
// fall through
#ifdef __clang__
[[clang::fallthrough]];
#endif
default:
std::cout << "some verbosity" << std::endl;
}
Expand Down

0 comments on commit 02f1298

Please sign in to comment.