mirror of
https://github.com/nasa/trick.git
synced 2025-01-18 02:40:08 +00:00
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:
commit
296bf77e74
@ -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" ;
|
||||
|
@ -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($) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user