From 8aa6843404f9c6faef66cb9c76358158eafc1af1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 11 Jan 2017 21:03:22 +0000 Subject: Explicitly pass -std=gnu++14 to clang when generating bindings The generator expression here looks like it should work, but it does not set the appropriate flags for compilation. It seems that the CXX_STANDARD property is not yet populated at the time the generator expression is evaluated (to be investigated later). This came to light because users of Qt 5.7+ attempted to generate the bindings, but they encountered errors. The step of using libclang to parse the provided headers was actually failing, but that was not noticed, perhaps because the logging infrastructure in sip_generator does not emit it (to investigate later). BUG: 374801 --- find-modules/FindPythonModuleGeneration.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'find-modules/FindPythonModuleGeneration.cmake') diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake index ed4f4a6e..2e6172aa 100644 --- a/find-modules/FindPythonModuleGeneration.cmake +++ b/find-modules/FindPythonModuleGeneration.cmake @@ -330,9 +330,11 @@ function(ecm_generate_python_binding endforeach() set(comp_defs "-D$,;-D>") - foreach(stdVar 11 14) - set(stdFlag "$<$,${stdVar}>:${CMAKE_CXX${stdVar}_EXTENSION_COMPILE_OPTION}>") - endforeach() + # We might like to use $, but + # unfortunately CMake does not populate that property as a side-effect of evaluating + # COMPILE_FEATURES (Qt specifies feature requirements in its INTERFACE_COMPILE_FEATURES, and + # those are consumed to set the CXX_STANDARD internally in CMake, but evidently too late) + set(stdFlag "-std=gnu++14") set(comp_flags "$;${stdFlag},;>") -- cgit v1.2.1