cmake: Handle compiler.find_library returning None

I'm not 100% sure that warning is the appropriate action, but it's
better than failing with a backtrace.

Fixes: #12555
pull/12579/head
Dylan Baker 1 year ago
parent 52638e8c65
commit a85353cd83
  1. 6
      mesonbuild/cmake/tracetargets.py

@ -55,7 +55,11 @@ def resolve_cmake_trace_targets(target_name: str,
# CMake brute-forces a combination of prefix/suffix combinations to find the # CMake brute-forces a combination of prefix/suffix combinations to find the
# right library. Assume any bare argument passed which is not also a CMake # right library. Assume any bare argument passed which is not also a CMake
# target must be a system library we should try to link against. # target must be a system library we should try to link against.
res.libraries += clib_compiler.find_library(curr, env, []) flib = clib_compiler.find_library(curr, env, [])
if flib is not None:
res.libraries += flib
else:
not_found_warning(curr)
else: else:
not_found_warning(curr) not_found_warning(curr)
continue continue

Loading…
Cancel
Save