From e3bc2e5c68c7590eaf5962fc87cfa587285900ef Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 1 Apr 2016 20:14:31 +0530 Subject: 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 --- mesonbuild/mesonmain.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild/mesonmain.py') 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': -- cgit v1.1