summaryrefslogtreecommitdiffstats
path: root/tools/qmake
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-01-31 17:43:10 +0100
committerMichal Klocek <michal.klocek@qt.io>2017-02-03 11:17:12 +0000
commitb183be09b52c6e7243ebecd7d98d4c34386b1dee (patch)
tree65573f1719370cee59cd31b82368389cd6fad581 /tools/qmake
parentabd581ac76131f1bb3d6c9699930ded81936a834 (diff)
Fix escaping of double-quotes
We are using double-quoted strings and should therefore be escaping double-quotation marks and not single-quotation ones. Change-Id: I0ae3bb45365843647b38c88a22379f89843dff54 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tools/qmake')
-rw-r--r--tools/qmake/mkspecs/features/gn_generator.prf13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/qmake/mkspecs/features/gn_generator.prf b/tools/qmake/mkspecs/features/gn_generator.prf
index ccc2831ae..5796c39a1 100644
--- a/tools/qmake/mkspecs/features/gn_generator.prf
+++ b/tools/qmake/mkspecs/features/gn_generator.prf
@@ -56,7 +56,7 @@ GN_CONTENTS += " sources = moc_source_h_files" \
" outputs = [ \"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\" ]"
GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
" args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\',)\","
+for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
GN_CONTENTS += " \"{{source}}\"," \
" \"-o\"," \
" rebase_path(\"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\")"\
@@ -70,7 +70,7 @@ GN_CONTENTS += " sources = moc_source_cpp_files" \
" outputs = [ \"$target_gen_dir/.moc/{{source_name_part}}.moc\" ]"
GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
" args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\',)\","
+for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
GN_CONTENTS += " \"{{source}}\"," \
" \"-o\"," \
" rebase_path(\"$target_gen_dir/.moc/{{source_name_part}}.moc\")"\
@@ -90,7 +90,7 @@ GN_CONTENTS += " ]" \
" outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]"
GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
" args = [" \
- " \"$$replace(CLEAN_QMAKE_RCC,\',)\","
+ " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\","
for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\""
GN_CONTENTS += " \"-name\"," \
" \"{{source_name_part}}\"," \
@@ -140,7 +140,12 @@ GN_CONTENTS += " if (!defined(defines)) {"\
GN_CONTENTS += " defines += ["
# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking
# the macro.
-for (define, DEFINES): GN_CONTENTS += " \"$$replace(define,\',)\","
+# Also add a layer of escaping for double quotes.
+for (define, DEFINES): {
+ define = $$replace(define,\",\\\")
+ define = $$replace(define,\',)
+ GN_CONTENTS += " \"$$define\","
+}
!isEmpty(QMAKE_LIBDIR_EGL):
GN_CONTENTS += " \"QT_LIBDIR_EGL=\\\"$${QMAKE_DIR_SEP}$$relative_path($$QMAKE_LIBDIR_EGL, $$[QT_SYSROOT])\\\"\","
!isEmpty(QMAKE_LIBDIR_OPENGL_ES2)