mk-unity: include the embedded source name in the output

Closes #17634
This commit is contained in:
Viktor Szakats 2025-06-16 08:57:45 +02:00
parent bb9955c865
commit 2ac18d7ae4
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -90,16 +90,17 @@ my $tlist = "";
foreach my $src (@src) {
if($src =~ /([a-z0-9]+)\.c$/ && !exists $exclude{$src}) {
my $name = $1;
my $fn = $src;
if($embed) {
my $fn = $src;
if($srcdir ne "" && -e "$srcdir/$fn") {
$fn = $srcdir . "/" . $fn;
}
print "/* Embedding: \"$src\" */\n";
my $content = do { local $/; open my $fh, '<', $fn or die $!; <$fh> };
print $content;
}
else {
print "#include \"$fn\"\n";
print "#include \"$src\"\n";
}
if(not exists $include{$src}) { # register test entry function
$tlist .= " {\"$name\", test_$name},\n";