From 40cb6baeea5196e5398ad57923a10eddfedf178f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 1 Dec 2023 11:40:08 +0200 Subject: [PATCH] Don't build internal OpenPGP parser when not using it This regressed in d2be4773b5e6c6358ef2f4c49b7cc727b5edf1eb which tried to shove the whole thing into the subdirectory for sawing off, but it doesn't quite work like that - you can't quite depend on an option that gets defined only if the option is defined... --- CMakeLists.txt | 1 + rpmio/CMakeLists.txt | 3 +-- rpmio/rpmpgp_legacy/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f95c1456c4..c8832775b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ option(WITH_AUDIT "Build with audit support" ON) option(WITH_FSVERITY "Build with fsverity support" OFF) option(WITH_IMAEVM "Build with IMA support" OFF) option(WITH_FAPOLICYD "Build with fapolicyd support" ON) +option(WITH_INTERNAL_OPENPGP "Use internal OpenPGP parser (DEPRECATED)" OFF) set(RPM_CONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib/rpm" CACHE PATH "rpm home") set(RPM_MACROSDIR "${RPM_CONFIGDIR}/macros.d") diff --git a/rpmio/CMakeLists.txt b/rpmio/CMakeLists.txt index a74991641d..a0f2f1d7fd 100644 --- a/rpmio/CMakeLists.txt +++ b/rpmio/CMakeLists.txt @@ -10,9 +10,8 @@ target_sources(librpmio PRIVATE target_compile_definitions(librpmio PRIVATE RPM_CONFIGDIR="${RPM_CONFIGDIR}") target_include_directories(librpmio PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -add_subdirectory(rpmpgp_legacy) - if (WITH_INTERNAL_OPENPGP) + add_subdirectory(rpmpgp_legacy) target_link_libraries(librpmio PRIVATE rpmpgp_legacy) else() pkg_check_modules(RPMSEQUOIA REQUIRED IMPORTED_TARGET rpm-sequoia>=1.4.0) diff --git a/rpmio/rpmpgp_legacy/CMakeLists.txt b/rpmio/rpmpgp_legacy/CMakeLists.txt index 38b102c394..b42c00f724 100644 --- a/rpmio/rpmpgp_legacy/CMakeLists.txt +++ b/rpmio/rpmpgp_legacy/CMakeLists.txt @@ -2,7 +2,6 @@ # it can only be built as a part of rpm build tree. add_library(rpmpgp_legacy OBJECT) -option(WITH_INTERNAL_OPENPGP "Use internal OpenPGP parser (DEPRECATED)" OFF) option(WITH_OPENSSL "Use openssl (instead of libgcrypt) for internal crypto" OFF) target_sources(rpmpgp_legacy PRIVATE