From 82baf747855174956b65be64a3c460da57f535bf Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 22 Dec 2019 12:31:14 -0800 Subject: [PATCH] Attempt to fix the build Move the CMake changes down in the file after the FIND_PACKAGE calls. --- cmake/ConfigureChecks.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 4d1de9cad..70ed8e5da 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -5,11 +5,6 @@ # This is the case for at least Cygwin and Newlib. LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1) - -# Work around the fact that cmake does not propagate the language standard flag into -# the CHECK_CXX_SOURCE_COMPILES function. See CMake issue #16456. -LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}") - IF(APPLE) INCLUDE(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-Werror=unguarded-availability" REQUIRES_UNGUARDED_AVAILABILITY) @@ -182,6 +177,12 @@ int main () { ENDIF() CMAKE_POP_CHECK_STATE() +# Work around the fact that cmake does not propagate the language standard flag into +# the CHECK_CXX_SOURCE_COMPILES function. See CMake issue #16456. +# Ensure we do this after the FIND_PACKAGE calls which use C, and will error on a C++ +# standards flag. +LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}") + CHECK_CXX_SOURCE_COMPILES(" #include