diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-09-29 21:15:00 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-10-01 23:47:19 +0200 |
commit | c53d35aa721e3c98590ef15c82a87b01ede9f628 (patch) | |
tree | 1ffaffd4cff94ec810c5fa8188dd1f6b4d4c4421 /mesonbuild/backend | |
parent | c38544a6ec3aaf8a160305a31684362ce7d450f9 (diff) | |
download | meson-c53d35aa721e3c98590ef15c82a87b01ede9f628.zip meson-c53d35aa721e3c98590ef15c82a87b01ede9f628.tar.gz meson-c53d35aa721e3c98590ef15c82a87b01ede9f628.tar.bz2 |
build: generate the mappings in the Targets
Before, the mappings has been created over all the links, while it
actaully only used the Shared or Static Targets. This structure now is
tree like structured and cached, thus the results can be computed a lot
faster.
The generator step generate_install is now for EFL from 6 sec. down to
0.3s. Which improves the overall build time from ~20 sec. to ~14 sec.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index e0a593f..0a28782 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -27,9 +27,6 @@ from collections import OrderedDict import shlex from functools import lru_cache -@lru_cache(maxsize=None) -def get_target_macos_dylib_install_name(ld): - return get_macos_dylib_install_name(ld.prefix, ld.name, ld.suffix, ld.soversion) class CleanTrees: @@ -970,29 +967,6 @@ class Backend: with open(install_data_file, 'wb') as ofile: pickle.dump(d, ofile) - def get_target_link_deps_mappings(self, t, prefix): - ''' - On macOS, we need to change the install names of all built libraries - that a target depends on using install_name_tool so that the target - continues to work after installation. For this, we need a dictionary - mapping of the install_name value to the new one, so we can change them - on install. - ''' - result = {} - if isinstance(t, build.StaticLibrary): - return result - for ld in t.get_all_link_deps(): - if ld is t or not isinstance(ld, build.SharedLibrary): - continue - old = get_target_macos_dylib_install_name(ld) - if old in result: - continue - fname = ld.get_filename() - outdirs, _ = ld.get_install_dir(self.environment) - new = os.path.join(prefix, outdirs[0], fname) - result.update({old: new}) - return result - def generate_target_install(self, d): for t in self.build.get_targets().values(): if not t.should_install(): @@ -1012,7 +986,7 @@ class Backend: # Install primary build output (library/executable/jar, etc) # Done separately because of strip/aliases/rpath if outdirs[0] is not False: - mappings = self.get_target_link_deps_mappings(t, d.prefix) + mappings = t.get_link_deps_mapping(d.prefix, self.environment) i = TargetInstallData(self.get_target_filename(t), outdirs[0], t.get_aliases(), should_strip, mappings, t.install_rpath, install_mode) |