Skip to content

Commit

Permalink
Fix librt logic
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Aug 21, 2022
1 parent 0441c25 commit a89e706
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,26 @@ system_lib_names = {
system_deps = [
dependency('threads'),
dependency('dl', required: false),
(host_os == 'linux') ? [dependency('rt', required: false)] : [],
]
foreach name : system_lib_names.get(host_os, [])
system_deps += cpp.find_library(name)
endforeach
if host_os == 'linux' and not cpp.has_function('clock_gettime')
system_deps += cpp.find_library('rt')
endif
zlib_dep = dependency('zlib')

if not meson.can_run_host_binaries()
system_native_deps = [
dependency('threads', native: true),
dependency('dl', native: true, required: false),
(build_os == 'linux') ? [dependency('rt', native: true, required: false)] : [],
]
foreach name : system_lib_names.get(build_os, [])
system_native_deps += cpp_native.find_library(name, native: true)
endforeach
if build_os == 'linux' and not cpp_native.has_function('clock_gettime')
system_native_deps += cpp_native.find_library('rt')
endif
zlib_native_dep = dependency('zlib', native: true)
endif

Expand Down

0 comments on commit a89e706

Please sign in to comment.