Skip to content

Commit

Permalink
Use the actual CMAKE_CXX_STANDARD provided by the workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach committed Dec 13, 2023
1 parent 19dd76b commit e6de2e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
strategy:
matrix:
build_type: [Debug, Release]
compiler:
- {cxx: "g++-9", c: "gcc-9"}
- {cxx: "g++-10", c: "gcc-10"}
- {cxx: "g++-11", c: "gcc-11"}
- {cxx: "clang++-13", c: "clang-13"}
- {cxx: "clang++-14", c: "clang-14"}
compiler: [clang++-13, clang++-14, g++-9, g++-10, g++-10, g++-11]
cxx_standard: [11, 14, 17, 20, 23]
exclude:
- compiler: clang++-13
cxx_standard: 23
- compiler: clang++-14
cxx_standard: 23

steps:
- uses: actions/checkout@v4
Expand All @@ -42,8 +42,7 @@ jobs:
-DVULKAN_HPP_TESTS_BUILD_ONLY_DYNAMIC=ON
-DVULKAN_HPP_TESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON
-DVULKAN_HPP_RUN_GENERATOR=ON
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}

Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

if ( NOT CMAKE_CXX_STANDARD )
set( CMAKE_CXX_STANDARD 11 )
endif()

# all the options for this project
option( VULKAN_HPP_PRECOMPILE "Precompile vulkan.hpp and vulkan_raii.hpp for sample builds" ON )
option( VULKAN_HPP_RUN_GENERATOR "Run the HPP generator" OFF )
Expand Down Expand Up @@ -121,7 +125,6 @@ function( vulkan_hpp__setup_library )
vulkan_hpp__setup_platform( NAME ${TARGET_NAME} )
vulkan_hpp__setup_vulkan_include( NAME ${TARGET_NAME} )
vulkan_hpp__setup_warning_level( NAME ${TARGET_NAME} )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON )
endif()
set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER ${TARGET_FOLDER} )
Expand All @@ -145,7 +148,7 @@ function( vulkan_hpp__setup_sample )
vulkan_hpp__setup_vulkan_include( NAME ${TARGET_NAME} )
vulkan_hpp__setup_warning_level( NAME ${TARGET_NAME} )

set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON )
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON )

if( TARGET_FOLDER )
set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER "${TARGET_FOLDER}" )
Expand Down Expand Up @@ -252,7 +255,7 @@ function( vulkan_hpp__setup_test )
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_test" )
endif()
if( NOT TARGET_CXX_STANDARD )
set( TARGET_CXX_STANDARD 11 )
set( TARGET_CXX_STANDARD ${CMAKE_CXX_STANDARD} )
endif()

vulkan_hpp__setup_project( NAME ${TARGET_NAME} )
Expand Down

0 comments on commit e6de2e1

Please sign in to comment.