From 5084a4d155de28ae39c310f77889f13119e545b4 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 5 Aug 2022 20:49:37 +0200 Subject: [PATCH 1/3] Use [[fallthrough]]; to mark whished fallthroughs - closes https://github.com/assimp/assimp/issues/4654 --- code/AssetLib/3DS/3DSConverter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/3DS/3DSConverter.cpp b/code/AssetLib/3DS/3DSConverter.cpp index 2421d5460..b4f625b76 100644 --- a/code/AssetLib/3DS/3DSConverter.cpp +++ b/code/AssetLib/3DS/3DSConverter.cpp @@ -262,7 +262,8 @@ void Discreet3DSImporter::ConvertMaterial(D3DS::Material &oldMat, unsigned int iWire = 1; mat.AddProperty((int *)&iWire, 1, AI_MATKEY_ENABLE_WIREFRAME); } -// fallthrough + [[fallthrough]]; + case D3DS::Discreet3DS::Gouraud: eShading = aiShadingMode_Gouraud; break; From 1b0682297df9728a13e6017af92de62d30ff01d2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 5 Aug 2022 21:06:10 +0200 Subject: [PATCH 2/3] Update to c++17 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c55fce0a..69187ce5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,7 +257,7 @@ ENDIF() # Grouped compiler settings ######################################## IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT MINGW) IF(NOT ASSIMP_HUNTER_ENABLED) - SET(CMAKE_CXX_STANDARD 11) + SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_POSITION_INDEPENDENT_CODE ON) ENDIF() # hide all not-exported symbols From ec131d03451d8f50706020155733930224735ee1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 5 Aug 2022 21:47:58 +0200 Subject: [PATCH 3/3] Update CMakeLists.txt --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69187ce5e..458a32834 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,8 +194,8 @@ SET (ASSIMP_SOVERSION 5) SET( ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources" ) if(NOT ASSIMP_HUNTER_ENABLED) - # Enable C++11 support globally - set(CMAKE_CXX_STANDARD 11) + # Enable C++17 support globally + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 99) endif() @@ -287,7 +287,7 @@ ELSEIF(MSVC) SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF") ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) IF(NOT ASSIMP_HUNTER_ENABLED) - SET(CMAKE_CXX_STANDARD 11) + SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_POSITION_INDEPENDENT_CODE ON) ENDIF() SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" ) @@ -299,7 +299,7 @@ ELSEIF( MINGW ) message(WARNING "MinGW is old, if you experience errors, update MinGW.") ENDIF() IF(NOT ASSIMP_HUNTER_ENABLED) - SET(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS "-std=gnu++17 ${CMAKE_CXX_FLAGS}") SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}") ENDIF() IF (CMAKE_BUILD_TYPE STREQUAL "Debug")