From e31b6e4a7b6b0b9504bea160cc7e8e811eb7b856 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 15 Feb 2016 13:28:35 +0530 Subject: 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. --- mesonbuild/backend/ninjabackend.py | 18 +++++++++--------- 1 file 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') -- cgit v1.1