From 62b4f2171b51fc4de2f1b9b10a6d33978755b9cc Mon Sep 17 00:00:00 2001 From: Snaipe Date: Mon, 16 Nov 2015 18:35:16 +0100 Subject: [PATCH] Fixed failing Appveyor MinGW builds due to '_hypot' not being defined. This is caused by a MinGW bug in math.h. See http://ehc.ac/p/mingw/bugs/2250/ for more information. --- CMakeLists.txt | 3 +++ appveyor.yml | 1 + samples/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96e093c..8749ac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ set(GettextTranslate_GMO_BINARY 1) add_definitions(-DCRITERION_BUILDING_DLL=1) +set(CMAKE_C_FLAGS_DEFAULT "${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS_DEFAULT "${CMAKE_CXX_FLAGS}") + if (NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -g -std=gnu99") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -g -std=c++11") diff --git a/appveyor.yml b/appveyor.yml index 22a8ea9..ba0e7da 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,7 @@ environment: matrix: - COMPILER: mingw GENERATOR: "MSYS Makefiles" + CXXFLAGS: -D__NO_INLINE__ - COMPILER: msvc GENERATOR: "Visual Studio 14 2015" CFLAGS: /MP diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 867cc94..cc3f9ac 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,6 +1,6 @@ if (NOT MSVC) - set(CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -pedantic") - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=c99 -Wall -Wextra -pedantic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} -std=c++11 -Wall -Wextra -pedantic") endif () include_directories(../include) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index da63852..4b57f05 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ if (NOT MSVC) - set(CMAKE_C_FLAGS "-std=gnu99 -Wall -Wextra") - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEFAULT} -std=gnu99 -Wall -Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEFAULT} -std=c++11 -Wall -Wextra") endif () include_directories(../include ../src)