mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:01:41 +03:00
lib: include files using known path
by including headers using "../[header]" when done from C files in subdirectories, we do not need to specify the lib source dir as an include path and we reduce the risk of header name collisions with headers in the SDK using the same file names. Idea-by: Kai Pastor Ref: #16949 Closes #16991
This commit is contained in:
parent
7e4d516bcb
commit
625f2c1644
71 changed files with 580 additions and 587 deletions
|
|
@ -35,6 +35,8 @@ if(!@ARGV) {
|
|||
die "Usage: $0 [<c-sources>] [--exclude <exclude-c-sources>]\n";
|
||||
}
|
||||
|
||||
my $srcdir = shift @ARGV;
|
||||
|
||||
# Specific sources to exclude or add as an extra source file
|
||||
my @src;
|
||||
my %exclude;
|
||||
|
|
@ -58,6 +60,11 @@ HEADER
|
|||
|
||||
foreach my $src (@src) {
|
||||
if($src =~ /\.c$/g && !exists $exclude{$src}) {
|
||||
print "#include \"$src\"\n";
|
||||
if(-e "$srcdir/$src") {
|
||||
print "#include \"$srcdir/$src\"\n";
|
||||
}
|
||||
else {
|
||||
print "#include \"$src\"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue