From 3bc9586e617447be4453a7e882e7898ffdd7d8b6 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 14:45:01 +0200 Subject: [PATCH] CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINES Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 402589451e4..34921b4e375 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')