Skip to content

Commit

Permalink
Handle C++ standard
Browse files Browse the repository at this point in the history
  • Loading branch information
pmai committed Jan 11, 2024
1 parent d80f658 commit 59c2534
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: cmake -DCMAKE_CXX_STANDARD=14 -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4
run: cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4

- name: Install ProtoBuf ${{ env.PROTOBUF_VERSION }}
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Configure C++ Build
working-directory: build
run: cmake -D FILTER_PROTO2CPP_PY_PATH=$GITHUB_WORKSPACE/proto2cpp ..
run: cmake -D FILTER_PROTO2CPP_PY_PATH=$GITHUB_WORKSPACE/proto2cpp ${{ env.PROTOBUF_VARIANT =='' && '-DCMAKE_CXX_STANDARD=17' }} ..

- name: Build C++
working-directory: build
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
endif()

# Set the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to be used")
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Optional Flatbuffer support
Expand Down

0 comments on commit 59c2534

Please sign in to comment.