Use the $PATH environment variable to pass extra dirs for DLLs

Unix developers, look away... this is how it's done on Windows: the
binary loader searches $PATH for the DLLs, so let's reuse the same
variable. This simplifies the command-line a little.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
Thiago Macieira 2013-10-08 21:07:43 -07:00
parent 9294d5984c
commit 245e29a72e
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@
use strict;
my %deploy;
my $objdump = $ENV{objdump} ? $ENV{objdump} : "i686-w64-mingw32-objdump";
my @searchdirs;
my @searchdirs = split(/:/, $ENV{PATH});
sub addDependenciesFor($) {
open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;

View file

@ -51,8 +51,8 @@ mac {
!win32-msvc* {
#!equals($$QMAKE_HOST.os, "Windows"): dlls.commands += OBJDUMP=`$(CC) -dumpmachine`-objdump
dlls.commands += PATH=\$\$PATH:`$(CC) -print-search-dirs | $(SED) -nE \'/^libraries: =/{s///;s,/lib/?(:|\\\$\$),/bin\\1,g;p;q;}\'`
dlls.commands += perl $$PWD/scripts/win-ldd.pl $(DESTDIR_TARGET)
dlls.commands += `$(CC) -print-search-dirs | $(SED) -n \'/^libraries: =/{s///;s/:/\\n/g;p;q;}\' | $(SED) -E \'s,/lib/?\\\$\$,/bin,\'`
dlls.commands += $$LIBS
dlls.commands += | while read name; do $(INSTALL_FILE) \$\$name $$PWD/$$WINDOWSSTAGING; done
dlls.depends = $(DESTDIR_TARGET)