Use check_symbol_exists instead of check_function_exists
ClosedPublic

Authored by heikobecker on Fri, Feb 8, 9:39 PM.

Details

Summary

check_function_exists has some shortcomings, which fails to detect
isnan when build against musl libc. The cmake documentation [1]
suggests to prefer check_symbol_exists, which detects isnan/isinf
fine on both glibc and musl.

[1] https://cmake.org/cmake/help/latest/module/CheckFunctionExists.html#command:check_function_exists

Test Plan

Builds with glibc and musl

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
heikobecker created this revision.Fri, Feb 8, 9:39 PM
Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptFri, Feb 8, 9:39 PM
Restricted Application added a subscriber: Calligra-Devel-list. · View Herald Transcript
heikobecker requested review of this revision.Fri, Feb 8, 9:39 PM

What about the other ​check_function_exists, should they also be changed?
Also, do you know when ​check_symbol_exists was introduced?
We still use cmake 2.8.12.

Replaced other check_function_exists invocations

What about the other ​check_function_exists, should they also be changed?

Changed them, too.

Also, do you know when ​check_symbol_exists was introduced?
We still use cmake 2.8.12.

No, but it's not that "new" and 2.8.12 definitely has it: https://cmake.org/cmake/help/v2.8.12/cmake.html#module:CheckSymbolExists

pino added a subscriber: pino.Sun, Feb 10, 11:14 AM
pino added inline comments.
filters/words/msword-odf/wv2/CMakeLists.txt
82

missing "h" in "zlib.h"

Added missing "h". Thanks for noticing that.

heikobecker marked an inline comment as done.Sun, Feb 10, 11:20 AM
danders accepted this revision.Mon, Feb 11, 9:56 AM
This revision is now accepted and ready to land.Mon, Feb 11, 9:56 AM
This revision was automatically updated to reflect the committed changes.