include all headers in sources.cmake Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/helper.pl b/helper.pl
index 3701799..e5ad27a 100755
--- a/helper.pl
+++ b/helper.pl
@@ -222,23 +222,31 @@ sub patch_file {
}
sub make_sources_cmake {
- my @list = @_;
+ my ($src_ref, $hdr_ref) = @_;
+ my @sources = @{ $src_ref };
+ my @headers = @{ $hdr_ref };
my $output = "# SPDX-License-Identifier: Unlicense
# Autogenerated File! Do not edit.
set(SOURCES\n";
- foreach my $obj (sort @list) {
- $output .= $obj . "\n";
+ foreach my $sobj (sort @sources) {
+ $output .= $sobj . "\n";
+ }
+ $output .= ")\n\nset(HEADERS\n";
+ foreach my $hobj (sort @headers) {
+ $output .= $hobj . "\n";
}
- $output .= ")\n\nset(HEADERS\ntommath.h\n)\n";
+ $output .= ")\n";
return $output;
}
sub process_makefiles {
my $write = shift;
my $changed_count = 0;
- my @o = map { my $x = $_; $x =~ s/\.c$/.o/; $x } bsd_glob("*.c");
- my @all = bsd_glob("*.{c,h}");
+ my @headers = bsd_glob("*.h");
+ my @sources = bsd_glob("*.c");
+ my @o = map { my $x = $_; $x =~ s/\.c$/.o/; $x } @sources;
+ my @all = sort(@sources, @headers);
my $var_o = prepare_variable("OBJECTS", @o);
(my $var_obj = $var_o) =~ s/\.o\b/.obj/sg;
@@ -260,7 +268,7 @@ sub process_makefiles {
for my $m (qw/ makefile makefile.shared makefile_include.mk makefile.msvc makefile.unix makefile.mingw sources.cmake /) {
my $old = read_file($m);
my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj)
- : $m eq 'sources.cmake' ? make_sources_cmake(bsd_glob("*.c"))
+ : $m eq 'sources.cmake' ? make_sources_cmake(\@sources, \@headers)
: patch_file($old, $var_o);
if ($old ne $new) {
diff --git a/sources.cmake b/sources.cmake
index 2bc8911..797d461 100644
--- a/sources.cmake
+++ b/sources.cmake
@@ -161,4 +161,9 @@ s_mp_zero_digs.c
set(HEADERS
tommath.h
+tommath_c89.h
+tommath_class.h
+tommath_cutoffs.h
+tommath_private.h
+tommath_superclass.h
)