summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-06 15:09:40 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-06 14:10:26 +0000
commitabe12f600b1f626c9d228ad5234c14784e7845f1 (patch)
tree408535fc609ab0dc81d8a6ab90d9dd8913bbd35f
parente7d1ec61e39da682fb4942af9a9bf74a9dd5913c (diff)
Simplify per-module option handling
Move flags/options that we use for modules from add_module to the new platform module target. Change-Id: I89e414690336dcd37253432fe5116226d1c8dd82 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtBuild.cmake14
-rw-r--r--cmake/QtInternalTargets.cmake14
2 files changed, 14 insertions, 14 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 3ea85504c2..8f0fbc674d 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1179,14 +1179,6 @@ 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()
- if(FEATURE_largefile)
- target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE")
- endif()
if(NOT ${arg_EXCEPTIONS})
qt_internal_set_no_exceptions_flags("${target}")
endif()
@@ -1332,12 +1324,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
if(NOT ${arg_DISABLE_TOOLS_EXPORT})
qt_export_tools(${target})
endif()
-
- # We can't use the gold linker on android with the NDK, which is the default
- # linker. To build our own target we will use the lld linker.
- if (ANDROID)
- target_link_options("${target}" PRIVATE -fuse-ld=lld)
- endif()
endfunction()
function(qt_export_tools module_name)
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index 832e5d21b4..7ca78fbbff 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -67,3 +67,17 @@ if(WARNINGS_ARE_ERRORS)
qt_internal_set_warnings_are_errors_flags(PlatformPluginInternal)
qt_internal_set_warnings_are_errors_flags(PlatformToolInternal)
endif()
+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(PlatformModuleInternal INTERFACE _USE_MATH_DEFINES)
+endif()
+if(FEATURE_largefile)
+ target_compile_definitions(PlatformModuleInternal INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE")
+endif()
+
+# We can't use the gold linker on android with the NDK, which is the default
+# linker. To build our own target we will use the lld linker.
+if (ANDROID)
+ target_link_options(PlatformModuleInternal INTERFACE -fuse-ld=lld)
+endif()