Merge pull request #872 from nasa/lib_deps_ext_lib_dir

Skip paths in TRICK_EXT_LIB_DIRS in get_lib_deps
This commit is contained in:
dbankieris 2019-09-27 10:57:43 -05:00 committed by GitHub
commit 296bf77e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -128,7 +128,6 @@ my @include_dirs = get_include_paths() ;
my @defines = get_defines() ;
my @exclude_paths = get_paths("TRICK_EXCLUDE") ;
my @swig_exclude_paths = get_paths("TRICK_SWIG_EXCLUDE") ;
my @ext_lib_paths = get_paths("TRICK_EXT_LIB_DIRS") ;
if ( "$ENV{'TRICK_CFLAGS'} $ENV{'TRICK_CXXFLAGS'}" !~ /DTRICK_VER=/ ) {
push @defines , "-DTRICK_VER=$year" ;

View File

@ -153,7 +153,7 @@ sub get_lib_deps ($$) {
}
}
}
return (@ordered_resolved_files) ;
return (grep { !is_path_in($_, "TRICK_EXT_LIB_DIRS") } @ordered_resolved_files) ;
}
sub write_lib_deps($) {

View File

@ -3,7 +3,7 @@ package get_paths ;
use Exporter ();
use Cwd 'abs_path' ;
@ISA = qw(Exporter);
@EXPORT = qw(get_paths get_include_paths get_defines);
@EXPORT = qw(get_paths get_include_paths get_defines is_path_in);
use strict ;
@ -20,4 +20,13 @@ sub get_defines {
return "$ENV{TRICK_CFLAGS} $ENV{TRICK_CXXFLAGS}" =~ /-D\S+/g
}
sub is_path_in {
foreach my $path (get_paths($_[1])) {
if ( $_[0] =~ /^\Q$path\E(.*)/ or abs_path($_[0]) =~ /^\Q$path\E(.*)/ ) {
return 1 ;
}
}
return 0 ;
}
1;