From b44576953cf94781c3256cd1077ba500fa1d89de Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Mon, 17 Jul 2023 10:31:55 +0200 Subject: [PATCH] Fixes builds without iberty-dev Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1041165 --- cmakemodules/script_bfd.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmakemodules/script_bfd.cmake b/cmakemodules/script_bfd.cmake index 02df37ac5c..3dc064021f 100644 --- a/cmakemodules/script_bfd.cmake +++ b/cmakemodules/script_bfd.cmake @@ -20,16 +20,16 @@ CHECK_INCLUDE_FILE("bfd.h" HAVE_BFD_H) find_library(BFD_LIBRARY NAMES libbfd.a) mark_as_advanced(BFD_LIBRARY) -if ((NOT HAVE_BFD_H) OR (NOT BFD_LIBRARY)) - # We need both, the .h and the .a to consider we have bfd available - return() -endif() - # Other Deps of BFD (needed since we are enforced to use static linking) find_library(Z_LIBRARY NAMES z libz.so libz) mark_as_advanced(Z_LIBRARY) - find_library(IBERTY_LIBRARY NAMES iberty libiberty.a) +mark_as_advanced(IBERTY_LIBRARY) + +if (NOT (HAVE_BFD_H AND BFD_LIBRARY AND Z_LIBRARY AND IBERTY_LIBRARY)) + # We need both, the .h and the .a to consider we have bfd available + return() +endif() set(BFD_LIBRARIES ${BFD_LIBRARY} ${Z_LIBRARY} ${CMAKE_DL_LIBS} ${IBERTY_LIBRARY})