From 9a36db7c88a058461f58bdbfec345b9c85753154 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 11 Feb 2021 13:13:18 +0100 Subject: [PATCH] Reactivate cmake unity support --- CMakeLists.txt | 20 ++++++++++---------- src/CMakeLists.txt | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b480515..05fbc17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,16 +97,16 @@ add_definitions(-DQT_NO_KEYWORDS) option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE) # Not supported yet -#option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE) - -#set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false) -#if (USE_UNITY_CMAKE_SUPPORT) -# if(${CMAKE_VERSION} VERSION_LESS "3.16.0") -# message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support") -# else() -# set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true) -# endif() -#endif() +option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE) + +set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false) +if (USE_UNITY_CMAKE_SUPPORT) + if(${CMAKE_VERSION} VERSION_LESS "3.16.0") + message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support") + else() + set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true) + endif() +endif() add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f90e10b..c565b5a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -234,6 +234,7 @@ qt5_add_dbus_interfaces(libmailcommon_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/dbusinter add_library(KF5MailCommon ${libmailcommon_SRCS}) if (COMPILE_WITH_UNITY_CMAKE_SUPPORT) set_target_properties(KF5MailCommon PROPERTIES UNITY_BUILD ON) + set_source_files_properties(${libmailcommon_search_SRCS} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() generate_export_header(KF5MailCommon BASE_NAME mailcommon)