mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
parent
5e11a40a69
commit
1f33406c95
@ -16,9 +16,13 @@ use gte ;
|
|||||||
use s_source ;
|
use s_source ;
|
||||||
use trick_print ;
|
use trick_print ;
|
||||||
use trick_version ;
|
use trick_version ;
|
||||||
|
use get_paths ;
|
||||||
|
use verbose_build ;
|
||||||
|
|
||||||
my %sim ;
|
my %sim ;
|
||||||
my $cwd = cwd();
|
my $cwd = cwd();
|
||||||
|
my $verbose_build = verbose_build() ;
|
||||||
|
my @ext_lib_paths = get_paths( "TRICK_EXT_LIB_DIRS" ) ;
|
||||||
|
|
||||||
# override the print format for help message
|
# override the print format for help message
|
||||||
*Pod::Text::seq_i = sub { return "[04m" . $_[1] . "[00m" } ;
|
*Pod::Text::seq_i = sub { return "[04m" . $_[1] . "[00m" } ;
|
||||||
@ -91,6 +95,10 @@ open LIBDEP, ">build/S_define.lib_deps" ;
|
|||||||
foreach my $file ( @{$sim{mis_entry_files}} ) {
|
foreach my $file ( @{$sim{mis_entry_files}} ) {
|
||||||
if ( $file ne "" ) {
|
if ( $file ne "" ) {
|
||||||
$file = abs_path(dirname($file)) . "/" . basename($file) ;
|
$file = abs_path(dirname($file)) . "/" . basename($file) ;
|
||||||
|
if ( my $path = get_containing_path( $file, @ext_lib_paths ) ) {
|
||||||
|
print "[95mDep Skip[39m TRICK_EXT_LIB_DIRS: [4m$path[24m" . substr($file, length $path) . "\n" if $verbose_build ;
|
||||||
|
next ;
|
||||||
|
}
|
||||||
print LIBDEP "$file\n" ;
|
print LIBDEP "$file\n" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ use verbose_build ;
|
|||||||
my %processed_files ;
|
my %processed_files ;
|
||||||
my %non_lib_processed_files ;
|
my %non_lib_processed_files ;
|
||||||
my $any_deps_changed = 0 ;
|
my $any_deps_changed = 0 ;
|
||||||
|
my $verbose_build = verbose_build() ;
|
||||||
|
|
||||||
sub exist_lib_deps(@) {
|
sub exist_lib_deps(@) {
|
||||||
my (@files_to_process) = @_ ;
|
my (@files_to_process) = @_ ;
|
||||||
@ -24,8 +25,8 @@ sub exist_lib_deps(@) {
|
|||||||
my ( $file, $dir, $suffix) = fileparse($l, qr/\.[^.]*/) ;
|
my ( $file, $dir, $suffix) = fileparse($l, qr/\.[^.]*/) ;
|
||||||
my ($lib_dep_file_name) = "build$dir${file}${suffix}.lib_deps" ;
|
my ($lib_dep_file_name) = "build$dir${file}${suffix}.lib_deps" ;
|
||||||
if ( ! -e $lib_dep_file_name ) {
|
if ( ! -e $lib_dep_file_name ) {
|
||||||
$any_deps_changed =1 ;
|
$any_deps_changed = 1 ;
|
||||||
print "[34mNewDep[0m $l\n" ;
|
print "[34mNew Dep[0m $l\n" ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +59,7 @@ sub read_lib_deps($@) {
|
|||||||
read_lib_deps($indent + 1 , @resolved_files) ;
|
read_lib_deps($indent + 1 , @resolved_files) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elsif ( verbose_build() ) {
|
} elsif ( $verbose_build ) {
|
||||||
print "[34mSkipping[0m Previously processed file \"$l\"\n" ;
|
print "[34mSkipping[0m Previously processed file \"$l\"\n" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,21 +126,6 @@ my @all_read_only_libs ;
|
|||||||
my @all_compile_libs ;
|
my @all_compile_libs ;
|
||||||
my %files_by_dir ;
|
my %files_by_dir ;
|
||||||
|
|
||||||
my @exclude_dirs ;
|
|
||||||
@exclude_dirs = split /:/ , "$ENV{TRICK_EXCLUDE}:$ENV{TRICK_EXT_LIB_DIRS}";
|
|
||||||
# See if there are any elements in the exclude_dirs array
|
|
||||||
if (scalar @exclude_dirs) {
|
|
||||||
@exclude_dirs = sort(@exclude_dirs );
|
|
||||||
# Error check - delete any element that is null
|
|
||||||
# (note: sort forced all blank names to front of array
|
|
||||||
@exclude_dirs = map { s/(^\s+|\s+$)//g ; $_ } @exclude_dirs ;
|
|
||||||
while ( scalar @exclude_dirs and not length @exclude_dirs[0] ) {
|
|
||||||
# Delete an element from the left side of an array (element zero)
|
|
||||||
shift @exclude_dirs ;
|
|
||||||
}
|
|
||||||
@exclude_dirs = map { (-e $_) ? abs_path($_) : $_ } @exclude_dirs ;
|
|
||||||
}
|
|
||||||
|
|
||||||
@all_cfly_files = keys %processed_files ;
|
@all_cfly_files = keys %processed_files ;
|
||||||
@all_read_only_libs = sort (grep /^-/ , @all_cfly_files) ;
|
@all_read_only_libs = sort (grep /^-/ , @all_cfly_files) ;
|
||||||
@all_compile_libs = grep /\.a$/ , @all_cfly_files ;
|
@all_compile_libs = grep /\.a$/ , @all_cfly_files ;
|
||||||
@ -183,17 +169,6 @@ foreach my $directory ( keys %files_by_dir ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach $k ( sort keys %files_by_dir ) {
|
|
||||||
foreach my $ie ( @exclude_dirs ) {
|
|
||||||
# if file location begins with $ie (an exclude dir)
|
|
||||||
if ( $k =~ /^\Q$ie/ ) {
|
|
||||||
delete $files_by_dir{$k} ;
|
|
||||||
print "[33mexcluding $k from build[00m\n" ;
|
|
||||||
last ; # break out of loop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
my $wd = abs_path(cwd()) ;
|
my $wd = abs_path(cwd()) ;
|
||||||
my $dt = localtime();
|
my $dt = localtime();
|
||||||
my ($trick_ver) = get_trick_version() ;
|
my ($trick_ver) = get_trick_version() ;
|
||||||
|
@ -6,11 +6,15 @@ use File::Path qw(make_path) ;
|
|||||||
use Exporter ();
|
use Exporter ();
|
||||||
use gte ;
|
use gte ;
|
||||||
use get_paths ;
|
use get_paths ;
|
||||||
|
use verbose_build ;
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT = qw(get_lib_deps write_lib_deps);
|
@EXPORT = qw(get_lib_deps write_lib_deps);
|
||||||
|
|
||||||
use strict ;
|
use strict ;
|
||||||
|
|
||||||
|
my $verbose_build = verbose_build() ;
|
||||||
|
my @ext_lib_paths = get_paths( "TRICK_EXT_LIB_DIRS" ) ;
|
||||||
|
|
||||||
sub get_lib_deps ($$) {
|
sub get_lib_deps ($$) {
|
||||||
my ($contents, $source_file_name) = @_ ;
|
my ($contents, $source_file_name) = @_ ;
|
||||||
my ($lib_deps) ;
|
my ($lib_deps) ;
|
||||||
@ -153,7 +157,16 @@ sub get_lib_deps ($$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (grep { !is_path_in($_, "TRICK_EXT_LIB_DIRS") } @ordered_resolved_files) ;
|
|
||||||
|
my @included_ordered_resolved_files;
|
||||||
|
foreach (@ordered_resolved_files) {
|
||||||
|
if ( my $exclude_path = get_containing_path( $_, @ext_lib_paths ) ) {
|
||||||
|
print "[95mDep Skip[39m TRICK_EXT_LIB_DIRS: [4m$exclude_path[24m" . substr($_, length $exclude_path) . "\n" if $verbose_build ;
|
||||||
|
next ;
|
||||||
|
}
|
||||||
|
push @included_ordered_resolved_files, $_ ;
|
||||||
|
}
|
||||||
|
return @included_ordered_resolved_files ;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub write_lib_deps($) {
|
sub write_lib_deps($) {
|
||||||
|
@ -3,7 +3,7 @@ package get_paths ;
|
|||||||
use Exporter ();
|
use Exporter ();
|
||||||
use Cwd 'abs_path' ;
|
use Cwd 'abs_path' ;
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT = qw(get_paths get_include_paths get_defines is_path_in);
|
@EXPORT = qw(get_paths get_include_paths get_defines get_containing_path);
|
||||||
|
|
||||||
use strict ;
|
use strict ;
|
||||||
|
|
||||||
@ -20,10 +20,11 @@ sub get_defines {
|
|||||||
return "$ENV{TRICK_CFLAGS} $ENV{TRICK_CXXFLAGS}" =~ /-D\S+/g
|
return "$ENV{TRICK_CFLAGS} $ENV{TRICK_CXXFLAGS}" =~ /-D\S+/g
|
||||||
}
|
}
|
||||||
|
|
||||||
sub is_path_in {
|
sub get_containing_path {
|
||||||
foreach my $path (get_paths($_[1])) {
|
my $path = shift;
|
||||||
if ( $_[0] =~ /^\Q$path\E(.*)/ or abs_path($_[0]) =~ /^\Q$path\E(.*)/ ) {
|
foreach my $exclude_path (@_) {
|
||||||
return 1 ;
|
if ( $path =~ /^\Q$exclude_path\E(.*)/ or abs_path($path) =~ /^\Q$exclude_path\E(.*)/ ) {
|
||||||
|
return $exclude_path ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0 ;
|
return 0 ;
|
||||||
|
0
test/SIM_exclusion_mechanisms/RUN_test/input.py
Normal file
0
test/SIM_exclusion_mechanisms/RUN_test/input.py
Normal file
26
test/SIM_exclusion_mechanisms/S_define
Normal file
26
test/SIM_exclusion_mechanisms/S_define
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
// @trick_link_dependency{ext_lib_dir/ExtLibDir.cpp}
|
||||||
|
|
||||||
|
#include "sim_objects/default_trick_sys.sm"
|
||||||
|
|
||||||
|
##include "Foo.hh"
|
||||||
|
|
||||||
|
##include "Exclude.hh"
|
||||||
|
##include "exclude/Exclude.hh"
|
||||||
|
##include "symlinks/exclude_link_path/links/exclude/Exclude.hh"
|
||||||
|
##include "symlinks/exclude_real_path/links/exclude/Exclude.hh"
|
||||||
|
|
||||||
|
##include "IcgExclude.hh"
|
||||||
|
##include "icg_exclude/IcgExclude.hh"
|
||||||
|
##include "symlinks/exclude_link_path/links/icg_exclude/IcgExclude.hh"
|
||||||
|
##include "symlinks/exclude_real_path/links/icg_exclude/IcgExclude.hh"
|
||||||
|
|
||||||
|
##include "SwigExclude.hh"
|
||||||
|
##include "swig_exclude/SwigExclude.hh"
|
||||||
|
##include "symlinks/exclude_link_path/links/swig_exclude/SwigExclude.hh"
|
||||||
|
##include "symlinks/exclude_real_path/links/swig_exclude/SwigExclude.hh"
|
||||||
|
|
||||||
|
##include "ExtLibDir.hh"
|
||||||
|
##include "ext_lib_dir/ExtLibDir.hh"
|
||||||
|
##include "symlinks/exclude_link_path/links/ext_lib_dir/ExtLibDir.hh"
|
||||||
|
##include "symlinks/exclude_real_path/links/ext_lib_dir/ExtLibDir.hh"
|
32
test/SIM_exclusion_mechanisms/S_overrides.mk
Normal file
32
test/SIM_exclusion_mechanisms/S_overrides.mk
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
MODELS := $(CURDIR)/models
|
||||||
|
TRICK_CXXFLAGS += -I$(MODELS)
|
||||||
|
|
||||||
|
TRICK_EXCLUDE += :$(MODELS)/Exclude.hh
|
||||||
|
TRICK_EXCLUDE += :$(MODELS)/exclude
|
||||||
|
TRICK_EXCLUDE += :$(MODELS)/symlinks/exclude_link_path/links/exclude
|
||||||
|
TRICK_EXCLUDE += :$(MODELS)/symlinks/exclude_real_path/real/exclude
|
||||||
|
|
||||||
|
TRICK_ICG_EXCLUDE += :$(MODELS)/IcgExclude.hh
|
||||||
|
TRICK_ICG_EXCLUDE += :$(MODELS)/icg_exclude
|
||||||
|
TRICK_ICG_EXCLUDE += :$(MODELS)/symlinks/exclude_link_path/links/icg_exclude
|
||||||
|
TRICK_ICG_EXCLUDE += :$(MODELS)/symlinks/exclude_real_path/real/icg_exclude
|
||||||
|
|
||||||
|
TRICK_SWIG_EXCLUDE += :$(MODELS)/SwigExclude.hh
|
||||||
|
TRICK_SWIG_EXCLUDE += :$(MODELS)/swig_exclude
|
||||||
|
TRICK_SWIG_EXCLUDE += :$(MODELS)/symlinks/exclude_link_path/links/swig_exclude
|
||||||
|
TRICK_SWIG_EXCLUDE += :$(MODELS)/symlinks/exclude_real_path/real/swig_exclude
|
||||||
|
|
||||||
|
TRICK_EXT_LIB_DIRS += :$(MODELS)/ExtLibDir.hh
|
||||||
|
TRICK_EXT_LIB_DIRS += :$(MODELS)/ExtLibDir.cpp
|
||||||
|
TRICK_EXT_LIB_DIRS += :$(MODELS)/ext_lib_dir
|
||||||
|
TRICK_EXT_LIB_DIRS += :$(MODELS)/symlinks/exclude_link_path/links/ext_lib_dir
|
||||||
|
TRICK_EXT_LIB_DIRS += :$(MODELS)/symlinks/exclude_real_path/real/ext_lib_dir
|
||||||
|
|
||||||
|
TRICKIFIED := $(MODELS)/trickified/trickified.o
|
||||||
|
TRICK_PYTHON_PATH += :$(MODELS)/trickified/python
|
||||||
|
TRICK_SWIG_FLAGS += -I$(MODELS)/trickified
|
||||||
|
TRICK_LDFLAGS += $(TRICKIFIED)
|
||||||
|
$(SWIG_SRC): $(TRICKIFIED)
|
||||||
|
|
||||||
|
$(TRICKIFIED):
|
||||||
|
@$(MAKE) -s -C $(MODELS)/trickified
|
22
test/SIM_exclusion_mechanisms/models/Exclude.hh
Normal file
22
test/SIM_exclusion_mechanisms/models/Exclude.hh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef EXCLUDE1
|
||||||
|
#define EXCLUDE1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class Exclude1A {
|
||||||
|
private:
|
||||||
|
void operator=(const Exclude1A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Exclude1B {
|
||||||
|
const std::vector<Exclude1A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
1
test/SIM_exclusion_mechanisms/models/ExtLibDir.cpp
Normal file
1
test/SIM_exclusion_mechanisms/models/ExtLibDir.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
This file should be excluded from the build. Is is meant to cause a compiler error if Trick tries to build it.
|
19
test/SIM_exclusion_mechanisms/models/ExtLibDir.hh
Normal file
19
test/SIM_exclusion_mechanisms/models/ExtLibDir.hh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// @trick_parse{everything}
|
||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
|
||||||
|
#ifndef EXT_LIB_DIR1
|
||||||
|
#define EXT_LIB_DIR1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of a Trickified library and is meant to be excluded from
|
||||||
|
* ICG via TRICK_EXT_LIB_DIRS. If the exclusion logic failts, the generated I/O
|
||||||
|
* code will result in multiple-definition errors at link time as the symbols
|
||||||
|
* will also exist in the Trickified partially-linked object.
|
||||||
|
*/
|
||||||
|
class ExtLibDir1 {
|
||||||
|
private:
|
||||||
|
void operator=(const ExtLibDir1&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
2
test/SIM_exclusion_mechanisms/models/Foo.cpp
Normal file
2
test/SIM_exclusion_mechanisms/models/Foo.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
// @trick_link_dependency{ext_lib_dir/ExtLibDir.cpp}
|
22
test/SIM_exclusion_mechanisms/models/Foo.hh
Normal file
22
test/SIM_exclusion_mechanisms/models/Foo.hh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// @trick_parse{everything}
|
||||||
|
// @trick_link_dependency{Foo.cpp}
|
||||||
|
|
||||||
|
#include "Exclude.hh"
|
||||||
|
#include "exclude/Exclude.hh"
|
||||||
|
#include "symlinks/exclude_link_path/links/exclude/Exclude.hh"
|
||||||
|
#include "symlinks/exclude_real_path/links/exclude/Exclude.hh"
|
||||||
|
|
||||||
|
#include "IcgExclude.hh"
|
||||||
|
#include "icg_exclude/IcgExclude.hh"
|
||||||
|
#include "symlinks/exclude_link_path/links/icg_exclude/IcgExclude.hh"
|
||||||
|
#include "symlinks/exclude_real_path/links/icg_exclude/IcgExclude.hh"
|
||||||
|
|
||||||
|
#include "SwigExclude.hh"
|
||||||
|
#include "swig_exclude/SwigExclude.hh"
|
||||||
|
#include "symlinks/exclude_link_path/links/swig_exclude/SwigExclude.hh"
|
||||||
|
#include "symlinks/exclude_real_path/links/swig_exclude/SwigExclude.hh"
|
||||||
|
|
||||||
|
#include "ExtLibDir.hh"
|
||||||
|
#include "ext_lib_dir/ExtLibDir.hh"
|
||||||
|
#include "symlinks/exclude_link_path/links/ext_lib_dir/ExtLibDir.hh"
|
||||||
|
#include "symlinks/exclude_real_path/links/ext_lib_dir/ExtLibDir.hh"
|
18
test/SIM_exclusion_mechanisms/models/IcgExclude.hh
Normal file
18
test/SIM_exclusion_mechanisms/models/IcgExclude.hh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef ICG_EXCLUDE1
|
||||||
|
#define ICG_EXCLUDE1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class IcgExclude1A {
|
||||||
|
private:
|
||||||
|
void operator=(const IcgExclude1A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class IcgExclude1B {
|
||||||
|
const std::vector<IcgExclude1A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
3
test/SIM_exclusion_mechanisms/models/SwigExclude.hh
Normal file
3
test/SIM_exclusion_mechanisms/models/SwigExclude.hh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
22
test/SIM_exclusion_mechanisms/models/exclude/Exclude.hh
Normal file
22
test/SIM_exclusion_mechanisms/models/exclude/Exclude.hh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef EXCLUDE2
|
||||||
|
#define EXCLUDE2
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class Exclude2A {
|
||||||
|
private:
|
||||||
|
void operator=(const Exclude2A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Exclude2B {
|
||||||
|
const std::vector<Exclude2A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
This file should be excluded from the build. Is is meant to cause a compiler error if Trick tries to build it.
|
@ -0,0 +1,19 @@
|
|||||||
|
// @trick_parse{everything}
|
||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
|
||||||
|
#ifndef EXT_LIB_DIR2
|
||||||
|
#define EXT_LIB_DIR2
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of a Trickified library and is meant to be excluded from
|
||||||
|
* ICG via TRICK_EXT_LIB_DIRS. If the exclusion logic failts, the generated I/O
|
||||||
|
* code will result in multiple-definition errors at link time as the symbols
|
||||||
|
* will also exist in the Trickified partially-linked object.
|
||||||
|
*/
|
||||||
|
class ExtLibDir2 {
|
||||||
|
private:
|
||||||
|
void operator=(const ExtLibDir2&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef ICG_EXCLUDE2
|
||||||
|
#define ICG_EXCLUDE2
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class IcgExclude2A {
|
||||||
|
private:
|
||||||
|
void operator=(const IcgExclude2A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class IcgExclude2B {
|
||||||
|
const std::vector<IcgExclude2A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,3 @@
|
|||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
../../real/exclude/Exclude.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/ext_lib_dir/ExtLibDir.cpp
|
@ -0,0 +1 @@
|
|||||||
|
../../real/ext_lib_dir/ExtLibDir.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/icg_exclude/IcgExclude.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/swig_exclude/SwigExclude.hh
|
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef EXCLUDE5
|
||||||
|
#define EXCLUDE5
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class Exclude5A {
|
||||||
|
private:
|
||||||
|
void operator=(const Exclude5A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Exclude5B {
|
||||||
|
const std::vector<Exclude5A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
This file should be excluded from the build. Is is meant to cause a compiler error if Trick tries to build it.
|
@ -0,0 +1,19 @@
|
|||||||
|
// @trick_parse{everything}
|
||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
|
||||||
|
#ifndef EXT_LIB_DIR3
|
||||||
|
#define EXT_LIB_DIR3
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of a Trickified library and is meant to be excluded from
|
||||||
|
* ICG via TRICK_EXT_LIB_DIRS. If the exclusion logic failts, the generated I/O
|
||||||
|
* code will result in multiple-definition errors at link time as the symbols
|
||||||
|
* will also exist in the Trickified partially-linked object.
|
||||||
|
*/
|
||||||
|
class ExtLibDir3 {
|
||||||
|
private:
|
||||||
|
void operator=(const ExtLibDir3&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef ICG_EXCLUDE3
|
||||||
|
#define ICG_EXCLUDE3
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class IcgExclude3A {
|
||||||
|
private:
|
||||||
|
void operator=(const IcgExclude3A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class IcgExclude3B {
|
||||||
|
const std::vector<IcgExclude3A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,3 @@
|
|||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
../../real/exclude/Exclude.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/ext_lib_dir/ExtLibDir.cpp
|
@ -0,0 +1 @@
|
|||||||
|
../../real/ext_lib_dir/ExtLibDir.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/icg_exclude/IcgExclude.hh
|
@ -0,0 +1 @@
|
|||||||
|
../../real/swig_exclude/SwigExclude.hh
|
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef EXCLUDE6
|
||||||
|
#define EXCLUDE6
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class Exclude6A {
|
||||||
|
private:
|
||||||
|
void operator=(const Exclude6A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Exclude6B {
|
||||||
|
const std::vector<Exclude6A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
This file should be excluded from the build. Is is meant to cause a compiler error if Trick tries to build it.
|
@ -0,0 +1,19 @@
|
|||||||
|
// @trick_parse{everything}
|
||||||
|
// @trick_link_dependency{ExtLibDir.cpp}
|
||||||
|
|
||||||
|
#ifndef EXT_LIB_DIR4
|
||||||
|
#define EXT_LIB_DIR4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of a Trickified library and is meant to be excluded from
|
||||||
|
* ICG via TRICK_EXT_LIB_DIRS. If the exclusion logic failts, the generated I/O
|
||||||
|
* code will result in multiple-definition errors at link time as the symbols
|
||||||
|
* will also exist in the Trickified partially-linked object.
|
||||||
|
*/
|
||||||
|
class ExtLibDir4 {
|
||||||
|
private:
|
||||||
|
void operator=(const ExtLibDir4&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef ICG_EXCLUDE4
|
||||||
|
#define ICG_EXCLUDE4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is meant to be excluded from ICG. It will produce ICG-generated
|
||||||
|
* code that does not compile (as long as
|
||||||
|
* https://github.com/nasa/trick/issues/422 isn't fixed).
|
||||||
|
*/
|
||||||
|
class IcgExclude4A {
|
||||||
|
private:
|
||||||
|
void operator=(const IcgExclude4A&);
|
||||||
|
};
|
||||||
|
|
||||||
|
class IcgExclude4B {
|
||||||
|
const std::vector<IcgExclude4A> foos;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,3 @@
|
|||||||
|
#ifdef SWIG
|
||||||
|
This file is meant to be excluded from SWIG. It will cause an error if SWIG tries to process it.
|
||||||
|
#endif
|
2
test/SIM_exclusion_mechanisms/models/trickified/.gitignore
vendored
Normal file
2
test/SIM_exclusion_mechanisms/models/trickified/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
python
|
||||||
|
trickified.o
|
9
test/SIM_exclusion_mechanisms/models/trickified/Makefile
Normal file
9
test/SIM_exclusion_mechanisms/models/trickified/Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
SIM_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/../..)
|
||||||
|
TRICK_HOME := $(abspath $(SIM_HOME)/../..)
|
||||||
|
export TRICKIFY_CXX_FLAGS := -I$(SIM_HOME)/models
|
||||||
|
|
||||||
|
all:
|
||||||
|
@$(MAKE) -s -f $(TRICK_HOME)/share/trick/makefiles/trickify.mk
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -rf build python trick trickified.o
|
@ -0,0 +1,8 @@
|
|||||||
|
#include "ExtLibDir.hh"
|
||||||
|
#include "ext_lib_dir/ExtLibDir.hh"
|
||||||
|
#include "symlinks/exclude_link_path/links/ext_lib_dir/ExtLibDir.hh"
|
||||||
|
#include "symlinks/exclude_real_path/links/ext_lib_dir/ExtLibDir.hh"
|
||||||
|
|
||||||
|
// https://github.com/nasa/trick/issues/881
|
||||||
|
//#include "symlinks/exclude_link_path/real/ext_lib_dir/ExtLibDir.hh"
|
||||||
|
//#include "symlinks/exclude_real_path/real/ext_lib_dir/ExtLibDir.hh"
|
@ -19,6 +19,7 @@ COMPILE_DIRS = \
|
|||||||
SIMS_NEEDING_TEST = \
|
SIMS_NEEDING_TEST = \
|
||||||
SIM_alloc_test \
|
SIM_alloc_test \
|
||||||
SIM_demo_inputfile \
|
SIM_demo_inputfile \
|
||||||
|
SIM_exclusion_mechanisms \
|
||||||
SIM_isystem \
|
SIM_isystem \
|
||||||
SIM_measurement_units \
|
SIM_measurement_units \
|
||||||
SIM_parse_s_define \
|
SIM_parse_s_define \
|
||||||
|
@ -524,7 +524,7 @@ bool PrintAttributes::isHeaderExcluded(const std::string& header, bool exclude_e
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp = almostRealPath(header.c_str());
|
temp = realpath(header.c_str(), NULL);
|
||||||
if ( temp ) {
|
if ( temp ) {
|
||||||
const std::string real_path = std::string(temp);
|
const std::string real_path = std::string(temp);
|
||||||
free(temp) ;
|
free(temp) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user