diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-02-28 11:27:02 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 18:19:19 +0100 |
commit | 7d371328265a4912fb323779adf95cc922a83541 (patch) | |
tree | 2e7a24c90828a11f0879e5877171a118a7e1fd92 /patches/chromium | |
parent | a2e45ded2dd1a9c183f1ff4ea84057f5c43972c5 (diff) |
Deploy QtWebEngineCore as a Qt module
This delegates the linking step from ninja to qmake so that we can
let qmake decide the destination of the target itself, easing the
deployment and installation logic across platforms.
The module is only deployed as a binary and no header are available
outside of the source tree. This is only to make sure that the
dependence of the QtWebEngine and QtWebEngineWidgets libraries on it
is resolved at runtime exactly the same way as with other Qt modules,
on all platforms.
Ninja still takes care of the compilation and gyp lets qmake know how
and what to link by dumping the list of flags and input files in a
generated .pri file.
This has to be done in a separate .pro file so that we can make sure
that ninja is run inconditionally before make reaches the dependency
check in core_module.pro, ensured by the parent Makefile.
Note 1: This patch removes RPATH hacks that are no longer necessary
Note 2: Other targets like ffmpegsumo are still linked by ninja. The
same logic could be moved to a qmake file but this require some more
work to make sure that some switches (e.g. -stdlib=libc++) are
coordinated between gyp and qmake.
Change-Id: If65968547bde5b9cf732e31e97931c17ae1921a7
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'patches/chromium')
-rw-r--r-- | patches/chromium/tools/gyp/0003-Allow-letting-qmake-do-the-link-step.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/patches/chromium/tools/gyp/0003-Allow-letting-qmake-do-the-link-step.patch b/patches/chromium/tools/gyp/0003-Allow-letting-qmake-do-the-link-step.patch new file mode 100644 index 000000000..8b86bd5ad --- /dev/null +++ b/patches/chromium/tools/gyp/0003-Allow-letting-qmake-do-the-link-step.patch @@ -0,0 +1,70 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jocelyn Turcotte <jocelyn.turcotte@digia.com> +Date: Thu, 27 Feb 2014 17:42:48 +0100 +Subject: Allow letting qmake do the link step + +This adds a let_qmake_do_the_linking target variable to tell ninja +not to link but rather dump the linking information from gyp in a +file that we'll parse with qmake. + +Change-Id: Icfaadae7ce4e9895f76b5fe06e05124e9b980e8b +Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu> +Reviewed-by: Andras Becsi <andras.becsi@digia.com> +--- + pylib/gyp/generator/ninja.py | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py +index 6fe07c5..c61f180 100644 +--- a/pylib/gyp/generator/ninja.py ++++ b/pylib/gyp/generator/ninja.py +@@ -1090,6 +1090,49 @@ class NinjaWriter: + else: + command = command + '_notoc' + ++ if config.get('let_qmake_do_the_linking', 0): ++ def toAbsPaths(paths): ++ return [os.path.relpath(path, self.toplevel_build) if os.path.isabs(path) else path ++ for path in paths] ++ def qmakeLiteral(s): ++ return s.replace('"', '\\"') ++ ++ # Generate this file for all solink targets, this assumes that ++ # a .pro file will pick up this pri file and do the rest of the work. ++ pri_file = open(os.path.join(self.toplevel_build, self.name + "_linking.pri"), 'w') ++ ++ if self.flavor == 'win': ++ # qmake will take care of the manifest ++ ldflags = filter(lambda x: not x.lower().startswith('/manifest'), ldflags) ++ ++ # Replace "$!PRODUCT_DIR" with "$$PWD" in link flags (which might contain some -L directives). ++ prefixed_lflags = [self.ExpandSpecial(f, '$$PWD') for f in ldflags] ++ prefixed_library_dirs = ['-L' + self.ExpandSpecial(f, '$$PWD') for f in config.get('library_dirs', [])] ++ prefixed_libraries = gyp.common.uniquer([self.ExpandSpecial(f, '$$PWD') for f in spec.get('libraries', [])]) ++ if self.flavor == 'mac': ++ prefixed_libraries = self.xcode_settings.AdjustLibraries(prefixed_libraries) ++ elif self.flavor == 'win': ++ prefixed_libraries = self.msvs_settings.AdjustLibraries(prefixed_libraries) ++ ++ # Make sure that we have relative paths to our out/(Release|Debug), where we generate our .pri file, and then prepend $$PWD to them. ++ prefixed_object_and_archives = ['$$PWD/' + o for o in toAbsPaths(link_deps)] ++ ++ pri_file.write("QMAKE_LFLAGS += %s\n" % qmakeLiteral(' '.join(prefixed_lflags))) ++ # Follow the logic of the solink rule. ++ if self.flavor != 'mac' and self.flavor != 'win': ++ pri_file.write("LIBS_PRIVATE += -Wl,--whole-archive %s -Wl,--no-whole-archive\n" % qmakeLiteral(' '.join(prefixed_object_and_archives))) ++ else: ++ pri_file.write("LIBS_PRIVATE += %s\n" % qmakeLiteral(' '.join(prefixed_object_and_archives))) ++ # External libs have to come after objects/archives, the linker resolve them in order. ++ pri_file.write("LIBS_PRIVATE += %s\n" % qmakeLiteral(' '.join(prefixed_library_dirs + prefixed_libraries))) ++ # Make sure that if ninja modifies one of the inputs, qmake/make will link again. ++ pri_file.write("POST_TARGETDEPS += %s\n" % qmakeLiteral(' '.join(prefixed_object_and_archives))) ++ pri_file.close() ++ ++ # In this mode we prevent letting ninja link at all. ++ command = 'phony' ++ command_suffix = '' ++ + if len(solibs): + extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs))) + |