From 799f0a3ac8e3d0161402e4ba3e112ea41da95c9c Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Mon, 2 Oct 2017 11:40:57 +0300 Subject: [PATCH 1/3] Fix warnings-as-errors flag on MSVC --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd5c86140..ba219a443 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,8 +219,12 @@ if (ASSIMP_COVERALLS) endif() if (ASSIMP_WERROR) + IF (MSVC) + add_compile_options(/WX) + ELSE() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + ENDIF() endif() INCLUDE (FindPkgMacros) From 003c728dafd69430b4f3c7bbffa669a8c2be4764 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Mon, 2 Oct 2017 11:43:29 +0300 Subject: [PATCH 2/3] appveyor: Treat warnings as errors --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 991cf5bc1..b8828710b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,8 +29,8 @@ install: build_script: - cd c:\projects\assimp -- if "%platform%" equ "x64" (cmake CMakeLists.txt -G "Visual Studio %Configuration% Win64") -- if "%platform%" equ "x86" (cmake CMakeLists.txt -G "Visual Studio %Configuration%") +- if "%platform%" equ "x64" (cmake CMakeLists.txt -DASSIMP_WERROR=ON -G "Visual Studio %Configuration% Win64") +- if "%platform%" equ "x86" (cmake CMakeLists.txt -DASSIMP_WERROR=ON -G "Visual Studio %Configuration%") - if "%platform%" equ "x64" (msbuild /m /p:Configuration=Release /p:Platform="x64" Assimp.sln) - if "%platform%" equ "x86" (msbuild /m /p:Configuration=Release /p:Platform="Win32" Assimp.sln) From b5db7d3649f06abd153a2f81fd4da4f4f70da3a2 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Mon, 2 Oct 2017 13:08:20 +0300 Subject: [PATCH 3/3] Disable warning 4351 on MSVC 2013 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba219a443..771800205 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,11 @@ IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW) ELSEIF(MSVC) # enable multi-core compilation with MSVC add_compile_options(/MP) + + # disable "elements of array '' will be default initialized" warning on MSVC2013 + IF(MSVC12) + add_compile_options(/wd4351) + ENDIF() ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fvisibility=hidden -fPIC -Wall -Wno-long-long -std=c++11" ) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")