From 5715ef13d217b087b87162fef86b0abc561177aa Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 3 Jun 2019 17:41:45 +0200 Subject: Add private define _USE_MATH_DEFINES on Windows for every module It's needed when building QtQml on Windows, otherwise compilation fails. Add it as a private define for every module being built, as it is done in qt_module.prf. Change-Id: I1e322d1da15adea8b3f037a722b3260a552dfb62 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmake') diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8e86590d33..ed6dba2dae 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1057,6 +1057,12 @@ function(add_qt_module target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + if(WIN32) + # Needed for M_PI define. Same as mkspecs/features/qt_module.prf. + # It's set for every module being built, but it's not propagated to user apps. + target_compile_definitions("${target}" PRIVATE _USE_MATH_DEFINES) + endif() + set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") qt_feature_module_begin( -- cgit v1.2.3