From 4e24ea29e24208d880cbce5aa4431d4f06ba09e5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 12 Apr 2019 12:44:59 +0200 Subject: [PATCH] [partition] [fsresizer] Adjust to post-3.3.0 API - KDE neon ships a post-3.3.0 KPMCore, with deprecations, but not yet the KPMCore 4 API, so add another API-version check to handle the deprecations. Keeps warnings down. --- src/modules/fsresizer/CMakeLists.txt | 3 +++ src/modules/partition/CMakeLists.txt | 3 +++ src/modules/partition/core/KPMHelpers.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/fsresizer/CMakeLists.txt b/src/modules/fsresizer/CMakeLists.txt index 4351dca51..582a02627 100644 --- a/src/modules/fsresizer/CMakeLists.txt +++ b/src/modules/fsresizer/CMakeLists.txt @@ -8,6 +8,9 @@ if ( KPMcore_FOUND ) include_directories( ${KPMCORE_INCLUDE_DIR} ) include_directories( ${PROJECT_BINARY_DIR}/src/libcalamares ) + if ( KPMcore_VERSION VERSION_GREATER "3.3.0") + list( APPEND _partition_defs WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations + endif() if ( KPMcore_VERSION VERSION_GREATER "3.90") list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API endif() diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 844c50ed4..9bcace064 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -27,6 +27,9 @@ set_package_properties( ) if ( KPMcore_FOUND ) + if ( KPMcore_VERSION VERSION_GREATER "3.3.0") + list( APPEND _partition_defs WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations + endif() if ( KPMcore_VERSION VERSION_GREATER "3.90") list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API endif() diff --git a/src/modules/partition/core/KPMHelpers.h b/src/modules/partition/core/KPMHelpers.h index aa279b1fb..b1c3832fc 100644 --- a/src/modules/partition/core/KPMHelpers.h +++ b/src/modules/partition/core/KPMHelpers.h @@ -33,7 +33,7 @@ class Partition; class PartitionNode; class PartitionRole; -#ifdef WITH_KPMCORE4API +#ifdef WITH_KPMCORE331API #define KPM_PARTITION_FLAG(x) PartitionTable::Flag::x #define KPM_PARTITION_STATE(x) Partition::State::x #define KPM_PARTITION_FLAG_ESP PartitionTable::Flag::Boot