aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-03-29 22:52:14 +0300
committerGitHub <noreply@github.com>2017-03-29 22:52:14 +0300
commit571451b521822aea71b8fe154217fc9a5ecfa005 (patch)
treefbf680b8ca7e52ce83a55f6fbb71244060e74a57 /mesonbuild/backend/backends.py
parent8cc89e468d4d8cfcafe7afd8884d9884d2aac751 (diff)
parent87f35d71184722aede59516f31de50411892599b (diff)
downloadmeson-571451b521822aea71b8fe154217fc9a5ecfa005.zip
meson-571451b521822aea71b8fe154217fc9a5ecfa005.tar.gz
meson-571451b521822aea71b8fe154217fc9a5ecfa005.tar.bz2
Merge pull request #1346 from msink/test-mingw
appveyor: run tests against MSYS2-MinGW
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index fa9a82f..99be172 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -601,8 +601,13 @@ class Backend:
def eval_custom_target_command(self, target, absolute_outputs=False):
# We want the outputs to be absolute only when using the VS backend
+ # XXX: Maybe allow the vs backend to use relative paths too?
+ source_root = self.build_to_src
+ build_root = '.'
outdir = self.get_target_dir(target)
if absolute_outputs:
+ source_root = self.environment.get_source_dir()
+ build_root = self.environment.get_source_dir()
outdir = os.path.join(self.environment.get_build_dir(), outdir)
outputs = []
for i in target.output:
@@ -628,6 +633,10 @@ class Backend:
elif not isinstance(i, str):
err_msg = 'Argument {0} is of unknown type {1}'
raise RuntimeError(err_msg.format(str(i), str(type(i))))
+ elif '@SOURCE_ROOT@' in i:
+ i = i.replace('@SOURCE_ROOT@', source_root)
+ elif '@BUILD_ROOT@' in i:
+ i = i.replace('@BUILD_ROOT@', build_root)
elif '@DEPFILE@' in i:
if target.depfile is None:
msg = 'Custom target {!r} has @DEPFILE@ but no depfile ' \