Commit 5bc4661c 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) (disable for the moment)
parent 114d11b6
Pipeline #44162 passed with stage
in 12 minutes and 46 seconds
......@@ -152,6 +152,16 @@ if(BUILD_TESTING)
set(BUILD_TOOLS TRUE)
endif()
#REACTIVATE IT 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()
set(SMI_MIN_VERSION "1.3")
find_package(SharedMimeInfo ${SMI_MIN_VERSION} REQUIRED)
......
......@@ -50,6 +50,9 @@ qt5_add_dbus_adaptor(akonadiagentbase_SRCS ../interfaces/org.kde.Akonadi.Account
accountsintegration.h Akonadi::AccountsIntegration accountsadaptor Akonadi__AccountsAdaptor)
add_library(KF5AkonadiAgentBase ${akonadiagentbase_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiAgentBase PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5AkonadiAgentBase BASE_NAME akonadiagentbase)
......
......@@ -14,6 +14,10 @@ ecm_qt_declare_logging_category(akonadi_agent_server_srcs HEADER akonadiagentser
add_executable(akonadi_agent_server ${akonadi_agent_server_srcs})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_agent_server PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(akonadi_agent_server PROPERTIES MACOSX_BUNDLE FALSE)
target_link_libraries(akonadi_agent_server
......@@ -32,6 +36,10 @@ set(akonadi_agent_launcher_SRCS
)
add_executable(akonadi_agent_launcher ${akonadi_agent_launcher_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_agent_launcher PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(akonadi_agent_launcher PROPERTIES MACOSX_BUNDLE FALSE)
target_link_libraries(akonadi_agent_launcher
......
......@@ -41,6 +41,10 @@ qt5_add_dbus_interface(control_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.fre
qt5_add_dbus_interface(control_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.PreprocessorManager.xml preprocessor_manager)
add_executable(akonadi_control ${control_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_control PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(akonadi_control PROPERTIES MACOSX_BUNDLE FALSE)
set_target_properties(akonadi_control PROPERTIES OUTPUT_NAME akonadi_control)
......
......@@ -20,6 +20,10 @@ qt5_add_dbus_interfaces(akonadictl_SRCS
)
add_executable(akonadictl ${akonadictl_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadictl PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(akonadictl PROPERTIES MACOSX_BUNDLE FALSE)
set_target_properties(akonadictl PROPERTIES OUTPUT_NAME akonadictl)
ecm_mark_nongui_executable(akonadictl)
......
......@@ -295,6 +295,9 @@ ecm_qt_declare_logging_category(akonadicore_SRCS HEADER akonadicore_debug.h IDEN
add_library(KF5AkonadiCore ${akonadicore_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiCore PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5AkonadiCore BASE_NAME akonadicore)
......
......@@ -71,6 +71,10 @@ else()
endif()
add_library(KF5AkonadiPrivate SHARED ${akonadiprivate_buildsources})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiPrivate PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::AkonadiPrivate ALIAS KF5AkonadiPrivate)
if (WIN32)
add_dependencies(KF5AkonadiPrivate generate_protocol)
......
......@@ -167,6 +167,10 @@ qt5_add_dbus_interface(libakonadiserver_SRCS ${Akonadi_SOURCE_DIR}/src/interface
qt5_add_resources(libakonadiserver_SRCS storage/akonadidb.qrc)
add_library(libakonadiserver STATIC ${libakonadiserver_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(libakonadiserver PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(libakonadiserver PROPERTIES OUTPUT_NAME akonadiserver)
target_link_libraries(libakonadiserver
akonadi_shared
......
......@@ -5,6 +5,10 @@ set(akonadi_shared_srcs
)
add_library(akonadi_shared STATIC ${akonadi_shared_srcs})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_shared PROPERTIES UNITY_BUILD ON)
endif()
target_include_directories(akonadi_shared INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(akonadi_shared
......
......@@ -100,6 +100,9 @@ ecm_generate_headers(AkonadiWidgets_HEADERS
ki18n_wrap_ui(akonadiwidgets_SRCS ${akonadiwidgets_UI})
add_library(KF5AkonadiWidgets ${akonadiwidgets_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiWidgets PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5AkonadiWidgets BASE_NAME akonadiwidgets)
......
......@@ -32,6 +32,10 @@ ecm_generate_headers(AkonadiXml_HEADERS
)
add_executable(akonadi2xml akonadi2xml.cpp)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi2xml PROPERTIES UNITY_BUILD ON)
endif()
set_target_properties(akonadi2xml PROPERTIES MACOSX_BUNDLE FALSE)
target_link_libraries(akonadi2xml
......
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