Commit 4bd49ca0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to use UNITY build see...

Allow to use UNITY build see https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html (Reduce compile time. Need cmake 3.16.0)
parent baa0b6a9
Pipeline #44112 passed with stage
in 34 minutes and 1 second
......@@ -161,6 +161,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(KUserFeedback 1.0.0 CONFIG)
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
option(USE_UNIFY_CMAKE_SUPPORT "Use UNIFY cmake support (speedup compile time)" FALSE)
set(COMPILE_WITH_CMAKE_SUPPORT false)
if (USE_UNIFY_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_CMAKE_SUPPORT true)
endif()
endif()
add_subdirectory(src)
add_subdirectory(agents)
add_subdirectory(ktnef)
......
......@@ -25,6 +25,9 @@ ecm_qt_declare_logging_category(libarchivemailagent_SRCS HEADER archivemailagent
ki18n_wrap_ui(libarchivemailagent_SRCS ui/archivemailwidget.ui )
add_library(archivemailagent STATIC ${libarchivemailagent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(archivemailagent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(archivemailagent
KF5::MailCommon
KF5::I18n
......@@ -86,5 +89,9 @@ target_link_libraries(archivemailagentconfig
KF5::XmlGui
KF5::I18n
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(archivemailagentconfig PROPERTIES UNITY_BUILD ON)
endif()
install(FILES settings/archivemailagentsettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
......@@ -33,6 +33,10 @@ qt5_add_dbus_interface(followupreminderagent_SRCS org.freedesktop.DBus.Propertie
add_library(followupreminderagent STATIC ${followupreminderagent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(followupreminderagent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(followupreminderagent
KF5::AkonadiCore
KF5::IdentityManagement
......
......@@ -21,6 +21,9 @@ ecm_qt_declare_logging_category(akonadi_mailfilter_agent_SRCS HEADER mailfiltera
add_executable(akonadi_mailfilter_agent ${akonadi_mailfilter_agent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_mailfilter_agent PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_mailfilter_agent PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${kmail_SOURCE_DIR}/agents/Info.plist.template)
......
......@@ -37,6 +37,10 @@ qt5_add_dbus_adaptor(sendlateragent_SRCS org.freedesktop.Akonadi.SendLaterAgent.
ki18n_wrap_ui(libsendlateragent_SRCS ui/sendlaterconfigurewidget.ui)
kconfig_add_kcfg_files(libsendlateragent_SRCS sendlateragentsettings.kcfgc)
add_library(sendlateragent STATIC ${libsendlateragent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(sendlateragent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(sendlateragent
KF5::AkonadiCore
KF5::AkonadiMime
......
......@@ -25,7 +25,9 @@ kconfig_add_kcfg_files(unifiedmailbox_agent_SRCS
qt5_add_dbus_adaptor(unifiedmailbox_agent_SRCS org.freedesktop.Akonadi.UnifiedMailboxAgent.xml unifiedmailboxagent.h UnifiedMailboxAgent)
add_executable(akonadi_unifiedmailbox_agent ${unifiedmailbox_agent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_unifiedmailbox_agent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(akonadi_unifiedmailbox_agent
KF5::AkonadiAgentBase
KF5::AkonadiMime
......
......@@ -24,6 +24,10 @@ ecm_add_app_icon(ktnef_SRCS ICONS ${ICONS_SRCS})
ki18n_wrap_ui(ktnef_SRCS ui/attachpropertywidgetbase.ui)
add_executable(ktnef ${ktnef_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(ktnef PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(ktnef
Qt5::Widgets
KF5::Tnef
......
......@@ -318,6 +318,10 @@ endif()
add_library(kmailprivate ${kmailprivate_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kmailprivate PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(kmailprivate BASE_NAME kmail)
target_link_libraries(kmailprivate
PRIVATE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment