diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-03 17:41:45 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-04 08:44:57 +0000 |
commit | 5715ef13d217b087b87162fef86b0abc561177aa (patch) | |
tree | 2a208692b11c2f6736251dac89b588bf00576120 /cmake | |
parent | 962ee4ea37f23000bbc342c5d50838abf0bcdb8e (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
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( |