-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CMake build warnings #360
Conversation
55233e7
to
46f969c
Compare
dev-bin/make-man-pages.pl
Outdated
} | ||
} | ||
|
||
sub _make_lib_man_links { | ||
my $target = shift; | ||
|
||
my $header = read_file("$Bin/../include/maxminddb.h"); | ||
my $header = read_file("$Bin/../include/maxminddb.h") | ||
or die "Failed to read header file: $!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like read_file
might already handle errors for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, at the very least autodie didn't cover them. Sorry about that.
dev-bin/make-man-pages.pl
Outdated
$file | ||
); | ||
$file, | ||
) or die "Failed to edit file: $!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise for edit_file
as with read_file
.
dev-bin/make-man-pages.pl
Outdated
for my $proto ( $header =~ /^ *extern.+?(MMDB_\w+)\(/gsm ) { | ||
open my $fh, '>', "$target/man/man3/$proto.3"; | ||
open my $fh, '>', "$target/man/man3/$proto.3" | ||
or die "Failed to open file: $!"; | ||
print {$fh} ".so man3/libmaxminddb.3\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think print
could fail too, but it looks like autodie
already didn't handle that!
dev-bin/make-man-pages.pl
Outdated
@@ -41,7 +40,7 @@ sub _make_man { | |||
|
|||
my $input = "$Bin/../doc/$name.md"; | |||
my $man_dir = "$target/man/man$section"; | |||
mkpath($man_dir); | |||
mkpath($man_dir) or die "Failed to create directory $man_dir: $!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly mkpath
handles errors already as well, although its docs seem more ambiguous to me!
This reduced the dependencies. See #359.
46f969c
to
3a0ab7e
Compare
Thanks for the quick response! However, now another issue has been unraveled for me:
By the way, should the man pages always be generated? It took some time for me (after installing the File::Slurp module that is). Could a flag to choose whether to generate them be useful? |
If you use the released source packages, e.g., libmaxminddb-1.11.0.tar.gz, you will not need to generate the man pages. We don't check in generated files into the repo. |
I am using the repo as a submodule and I build it using CMake. I would prefer it if people who built my project wouldn't get warnings (now there still is one due to the nonstandard |
We don't have plans to commit generated files to the repo. I think we would accept a PR to disable man page generation. I'll go ahead and make a small PR to remove the dependency on non-core Perl modules as that seems beneficial generally, but the man-page generation will still depend on |
Thanks again, seems to be working as intended! Apparently (from code inspection), it checks and handles the absence of |
Closes #359.