Commit 0ec67801 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 a42a452a
Pipeline #44120 passed with stage
in 11 minutes and 21 seconds
......@@ -95,7 +95,16 @@ set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib"
if (TARGET KUserFeedbackWidgets)
add_definitions(-DWITH_KUSERFEEDBACK)
endif()
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(kontactplugin)
......
......@@ -81,6 +81,9 @@ qt5_add_dbus_adaptor( kaddressbook_LIB_SRCS org.kde.kaddressbook.xml mainwidget.
kconfig_add_kcfg_files(kaddressbook_LIB_SRCS settings/settings.kcfgc)
add_library(kaddressbookprivate ${kaddressbook_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbookprivate PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(kaddressbookprivate BASE_NAME kaddressbook)
target_link_libraries(kaddressbookprivate
PUBLIC
......@@ -124,8 +127,10 @@ set(kaddressbook_SRCS
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kaddressbook.png")
ecm_add_app_icon(kaddressbook_SRCS ICONS ${ICONS_SRCS})
add_executable(kaddressbook ${kaddressbook_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook
KF5::KontactInterface
......
......@@ -12,7 +12,9 @@ ecm_qt_declare_logging_category(kcm_config_plugins_SRCS HEADER kaddressbook_conf
add_library(kaddressbook_config_plugins MODULE ${kcm_config_plugins_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kaddressbook_config_plugins PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kaddressbook_config_plugins
KF5::KCMUtils
KF5::I18n
......
......@@ -26,6 +26,10 @@ ecm_qt_declare_logging_category(kaddressbook_importexport_LIB_SRCS
add_library(KPimAddressbookImportExport ${kaddressbook_importexport_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimAddressbookImportExport PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimAddressbookImportExport BASE_NAME kaddressbook_importexport)
add_library(KPim::AddressbookImportExport ALIAS KPimAddressbookImportExport)
......
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