Commit 6dd8ae14 authored by Laurent Montel's avatar Laurent Montel 😁

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) (disable for the moment)
parent 66757e26
Pipeline #44290 failed with stage
in 29 minutes and 44 seconds
......@@ -159,6 +159,17 @@ find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
add_definitions(-DQT_NO_EMIT)
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_subdirectory(resources)
add_subdirectory(agents)
add_subdirectory(defaultsetup)
......
......@@ -25,7 +25,9 @@ qt5_add_dbus_adaptor( maildispatcheragent_SRCS
)
add_executable(akonadi_maildispatcher_agent ${maildispatcheragent_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_maildispatcher_agent PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_maildispatcher_agent PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
......
......@@ -17,6 +17,9 @@ set(migrationagent_SRCS
)
add_executable(akonadi_migration_agent ${migrationagent_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_migration_agent PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_migration_agent PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
......
......@@ -26,6 +26,9 @@ set(newmailnotifieragent_SRCS
qt5_add_dbus_adaptor(newmailnotifieragent_SRCS org.freedesktop.Akonadi.NewMailNotifier.xml newmailnotifieragent.h NewMailNotifierAgent)
add_executable( akonadi_newmailnotifier_agent ${newmailnotifieragent_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_newmailnotifier_agent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries( akonadi_newmailnotifier_agent
KF5::AkonadiCore
......
......@@ -20,6 +20,9 @@ ecm_qt_declare_logging_category(migrationshared_SRCS
)
add_library(migrationshared STATIC ${migrationshared_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(migrationshared PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(migrationshared
KF5::AkonadiCore
KF5::ConfigCore
......
......@@ -4,6 +4,10 @@ set(gid_SRCS
)
add_library(gidmigration STATIC ${gid_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(gidmigration PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(gidmigration
migrationshared
KF5::I18n
......
......@@ -30,6 +30,9 @@ qt5_add_dbus_adaptor(akonotesresource_SRCS
install( FILES akonotesresource.desktop DESTINATION "${KDE_INSTALL_DATAROOTDIR}/akonadi/agents" )
add_executable(akonadi_akonotes_resource ${akonotesresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_akonotes_resource PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(akonadi_akonotes_resource
KF5::AkonadiCore
......
......@@ -27,6 +27,9 @@ ecm_qt_declare_logging_category(birthdayresource_srcs HEADER birthdays_debug.h I
add_executable(akonadi_birthdays_resource ${birthdayresource_srcs})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_birthdays_resource PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_birthdays_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
......
......@@ -54,6 +54,9 @@ qt5_add_dbus_adaptor(davgroupwareresource_SRCS
)
add_executable(akonadi_davgroupware_resource ${davgroupwareresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_davgroupware_resource PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_davgroupware_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../../Info.plist.template)
......
......@@ -9,6 +9,9 @@ set(folderarchivesettings_SRCS
add_library(folderarchivesettings ${folderarchivesettings_SRCS} )
generate_export_header(folderarchivesettings BASE_NAME folderarchivesettings)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(folderarchivesettings PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(folderarchivesettings
PRIVATE
......
......@@ -34,6 +34,9 @@ qt5_add_dbus_adaptor(icalresource_SRCS
)
add_executable(akonadi_ical_resource ${icalresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_ical_resource PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_ical_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
......
......@@ -64,6 +64,9 @@ target_link_libraries(akonadi_mixedmaildir_resource
KF5::I18n
akonadi-singlefileresource
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_mixedmaildir_resource PROPERTIES UNITY_BUILD ON)
endif()
install(TARGETS akonadi_mixedmaildir_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.MixedMaildir.Settings.xml
......
......@@ -50,6 +50,9 @@ qt5_add_dbus_adaptor(openxchangeresource_SRCS
)
add_executable(akonadi_openxchange_resource ${openxchangeresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_openxchange_resource PROPERTIES UNITY_BUILD ON)
endif()
if( APPLE )
set_target_properties(akonadi_openxchange_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
......
......@@ -49,6 +49,9 @@ target_link_libraries( akonadi_pop3_resource
KF5::PimCommon
qt5keychain
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_pop3_resource PROPERTIES UNITY_BUILD ON)
endif()
if(BUILD_TESTING)
add_subdirectory( autotests )
......
......@@ -27,6 +27,9 @@ ecm_qt_declare_logging_category(akonadi-filestore_SRCS HEADER akonadifilestore_d
add_library(akonadi-filestore ${akonadi-filestore_SRCS} )
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi-filestore PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(akonadi-filestore BASE_NAME akonadi-filestore)
target_link_libraries(akonadi-filestore
......
......@@ -33,6 +33,9 @@ ki18n_wrap_ui(akonadi-singlefileresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARE
add_library(akonadi-singlefileresource ${akonadi-singlefileresource_SRCS} )
generate_export_header(akonadi-singlefileresource BASE_NAME akonadi-singlefileresource)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi-singlefileresource PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(akonadi-singlefileresource
PUBLIC
......
......@@ -61,6 +61,9 @@ qt5_add_dbus_adaptor(tomboynotesresource_SRCS
add_executable(akonadi_tomboynotes_resource ${tomboynotesresource_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_tomboynotes_resource PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(akonadi_tomboynotes_resource
Qt5::DBus
Qt5::Gui
......
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