diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-02-15 13:28:35 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-17 20:01:31 +0200 |
commit | e31b6e4a7b6b0b9504bea160cc7e8e811eb7b856 (patch) | |
tree | b2f7f0261e58273d159b7055eaed505d448d2998 | |
parent | 31fc897496dc1759c3fd3db38bd4ab2b082d5a67 (diff) | |
download | meson-e31b6e4a7b6b0b9504bea160cc7e8e811eb7b856.zip meson-e31b6e4a7b6b0b9504bea160cc7e8e811eb7b856.tar.gz meson-e31b6e4a7b6b0b9504bea160cc7e8e811eb7b856.tar.bz2 |
ninjabackend: Try symlinking and ignore if it doesn't work
Instead of checking if we're on Windows and not even trying, try to symlink and
if that fails due to insufficient privileges, then just continue. This allows
people who know what they're doing to allow users other than Administrators to
make symlinks on Windows, or allows them to just run Meson as an Administrator.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 7581f27..1a051c5 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1717,16 +1717,16 @@ rule FORTRAN_DEP_HACK def generate_shlib_aliases(self, target, outdir): basename = target.get_filename() aliases = target.get_aliaslist() - if not mesonlib.is_windows(): - for alias in aliases: - aliasfile = os.path.join(self.environment.get_build_dir(), outdir, alias) - try: - os.remove(aliasfile) - except Exception: - pass + for alias in aliases: + aliasfile = os.path.join(self.environment.get_build_dir(), outdir, alias) + try: + os.remove(aliasfile) + except Exception: + pass + try: os.symlink(basename, aliasfile) - else: - mlog.debug("Library versioning disabled because host does not support symlinks.") + except OSError: + mlog.debug("Library versioning disabled because we do not have symlink creation privileges") def generate_gcov_clean(self, outfile): gcno_elem = NinjaBuildElement(self.all_outputs, 'clean-gcno', 'CUSTOM_COMMAND', 'PHONY') |