Skip to content

Commit 2439502

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>
1 parent 06b2705 commit 2439502

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
@@ -728,10 +728,10 @@ if not cc.has_function('socket')
728728
endif
729729
endif
730730

731+
lib_rt = cc.find_library('rt', required : false)
731732
realtime_libs = []
732733
have = cc.has_function('clock_gettime')
733734
if not have
734-
lib_rt = cc.find_library('rt', required : false)
735735
if lib_rt.found()
736736
realtime_libs += lib_rt
737737
have = cc.has_function('clock_gettime',
@@ -744,7 +744,6 @@ thread_libs = dependency('threads')
744744

745745
have = cc.has_function('timer_create')
746746
if not have
747-
lib_rt = cc.find_library('rt', required : false)
748747
if lib_rt.found()
749748
realtime_libs = [lib_rt]
750749
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, errnos_h,

0 commit comments

Comments
 (0)