diff --git a/.github/workflows/cpp_ubuntu20_04.yml b/.github/workflows/cpp_ubuntu20_04.yml index 8b9f0ba..d588868 100644 --- a/.github/workflows/cpp_ubuntu20_04.yml +++ b/.github/workflows/cpp_ubuntu20_04.yml @@ -3,6 +3,9 @@ on: pull_request: branches: - "master" + push: + branches: + - "master" jobs: build: @@ -12,8 +15,9 @@ jobs: matrix: rosdistro: ['noetic'] gcc: ['8', '9', '10'] + cxx: ['11', '14', '17'] container: ros:${{ matrix.rosdistro }}-ros-base-focal - name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} + name: ROS ${{ matrix.rosdistro }} - GCC ${{ matrix.gcc }} - C++${{ matrix.cxx }} steps: - uses: actions/checkout@v3 name: Checkout lpp @@ -35,7 +39,7 @@ jobs: run: sudo apt install -y libgoogle-glog-dev - name: Build lpp - run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build lpp && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash + run: source /opt/ros/${{ matrix.rosdistro }}/setup.bash && catkin build -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} lpp && source ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash working-directory: catkin_ws shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index b09bffa..262d95a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) endif () # Set standard of top level project or C++17 -if (NOT DEFINED ${CMAKE_CXX_STANDARD}) +if (NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 17) else () set(CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD}) diff --git a/src/demo.cpp b/src/demo.cpp index 46a0944..24d4306 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -4,7 +4,7 @@ #include -int main(int argc, char **argv) { +int main([[maybe_unused]] int argc, char **argv) { LOG_INIT(argv[0]); int foo = 5;