diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 901c743ba..4d1de9cad 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -4,6 +4,12 @@ # `wcstod_l` is a GNU-extension, sometimes hidden behind GNU-related defines. # 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) diff --git a/config_cmake.h.in b/config_cmake.h.in index ea7e90820..471094269 100644 --- a/config_cmake.h.in +++ b/config_cmake.h.in @@ -127,6 +127,9 @@ /* Define to 1 if the _nl_msg_cat_cntr symbol is exported. */ #cmakedefine HAVE__NL_MSG_CAT_CNTR 1 +/* Define to 1 if std::make_unique is available. */ +#cmakedefine HAVE_STD__MAKE_UNIQUE 1 + /* Define to 1 if the _sys_errs array is available. */ #cmakedefine HAVE__SYS__ERRS 1