Skip to content

Commit a1b444c

Browse files
committed
meson: Only pick up the rt library once
Require the rt library for the build-lsfd feature. Signed-off-by: Jordan Williams <jordan@jwillikers.com> (cherry picked from commit 2439502)
1 parent 39da84f commit a1b444c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

meson.build

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,10 @@ if not cc.has_function('socket')
729729
endif
730730
endif
731731

732+
lib_rt = cc.find_library('rt', required : false)
732733
realtime_libs = []
733734
have = cc.has_function('clock_gettime')
734735
if not have
735-
lib_rt = cc.find_library('rt', required : false)
736736
if lib_rt.found()
737737
realtime_libs += lib_rt
738738
have = cc.has_function('clock_gettime',
@@ -745,7 +745,6 @@ thread_libs = dependency('threads')
745745

746746
have = cc.has_function('timer_create')
747747
if not have
748-
lib_rt = cc.find_library('rt', required : false)
749748
if lib_rt.found()
750749
realtime_libs = [lib_rt]
751750
have = cc.has_function('timer_create',
@@ -2717,9 +2716,7 @@ errnos_h = custom_target('errnos.h',
27172716
command : ['tools/all_errnos', cc.cmd_array(), get_option('c_args')],
27182717
)
27192718

2720-
lib_rt = cc.find_library('rt', required : get_option('build-lsfd'))
2721-
2722-
opt = not get_option('build-lsfd').disabled()
2719+
opt = not get_option('build-lsfd').require(lib_rt.found()).disabled()
27232720
exe = executable(
27242721
'lsfd',
27252722
lsfd_sources,

0 commit comments

Comments
 (0)