mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
waf: cxx_checks: add check_librt()
That function verifies for the necessity of linking against librt. If so, then it checks if it is possible to do so.
This commit is contained in:
parent
e630c2b33f
commit
f10c150e70
@ -123,3 +123,27 @@ def ap_common_checks(cfg):
|
||||
msg="Checking for NEED_CMATH_ISNAN_STD_NAMESPACE",
|
||||
mandatory=False,
|
||||
)
|
||||
|
||||
@conf
|
||||
def check_librt(cfg):
|
||||
success = cfg.check(
|
||||
compiler='cxx',
|
||||
fragment='''
|
||||
#include <time.h>
|
||||
|
||||
int main() {
|
||||
clock_gettime(CLOCK_REALTIME, NULL);
|
||||
}''',
|
||||
msg='Checking for need to link with librt',
|
||||
okmsg='not necessary',
|
||||
errmsg='necessary',
|
||||
mandatory=False,
|
||||
)
|
||||
|
||||
if success:
|
||||
return success
|
||||
|
||||
return cfg.check(
|
||||
compiler='cxx',
|
||||
lib='rt',
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user