summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-08 14:45:01 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-09 07:29:08 +0000
commit3bc9586e617447be4453a7e882e7898ffdd7d8b6 (patch)
treec1a6660b3e520b3834813dd020f265f0c1c860d2 /util
parent3cf92ab183eec9caadcba4ababcf7ea644f711dd (diff)
CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINES
Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 402589451e..34921b4e37 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -996,6 +996,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *,
cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_interface_flags)))
defines = scope.expand('DEFINES')
+ defines += [d[2:] for d in scope.expand('QMAKE_CXXFLAGS') if d.startswith('-D')]
if defines:
cm_fh.write('{} DEFINES\n'.format(ind))
for d in defines:
@@ -1015,12 +1016,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *,
['QT',],
indent=indent, known_libraries=known_libraries)
- compile_options = scope.get('QMAKE_CXXFLAGS')
+ compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')]
if compile_options:
cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind))
for co in compile_options:
- if co.startswith('-D'):
- co = co[2:]
cm_fh.write('{} "{}"\n'.format(ind, co))
link_options = scope.get('QMAKE_LFLAGS')