aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2016-04-01 20:14:31 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-04-15 05:49:42 +0530
commite3bc2e5c68c7590eaf5962fc87cfa587285900ef (patch)
treedf32ccf51ea8082b1aad13345aa5d87fffc3a382 /mesonbuild/mesonmain.py
parent563b978bf268ef9f6bf717929b472bc078fe95de (diff)
downloadmeson-e3bc2e5c68c7590eaf5962fc87cfa587285900ef.zip
meson-e3bc2e5c68c7590eaf5962fc87cfa587285900ef.tar.gz
meson-e3bc2e5c68c7590eaf5962fc87cfa587285900ef.tar.bz2
ninja: Set PATH for CustomTargets with built EXEs on Windows
When a CustomTarget is run with a command that is an executable built by the project which also has a DLL built in the same project as a dependency, the EXE can't run on Windows because the DLL can't be found. On UNIX-like systems, we set the RPATH using the linker so these dependencies can be found, but on Windows the only way is to set the PATH environment variable. The same problem exists for tests, so we reuse that infrastructure by creating a new meson_exe.py script that can be used as a wrapper to run CustomTarget commands on Windows. This can later also be extended to add support for setting an environment while calling the command needed to generate a CustomTarget: https://github.com/mesonbuild/meson/issues/266
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 3b05afb..052c178 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -163,7 +163,10 @@ itself as required.'''
def run_script_command(args):
cmdname = args[0]
cmdargs = args[1:]
- if cmdname == 'test':
+ if cmdname == 'exe':
+ import mesonbuild.scripts.meson_exe as abc
+ cmdfunc = abc.run
+ elif cmdname == 'test':
import mesonbuild.scripts.meson_test as abc
cmdfunc = abc.run
elif cmdname == 'benchmark':