Commit dc7e80d1 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 6b9bd3c7
Pipeline #44155 passed with stage
in 13 minutes and 45 seconds
......@@ -119,7 +119,17 @@ configure_file(knotes-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/knotes-version
if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
endif()
#Laurent: disable for the moment
#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(noteshared)
add_subdirectory(src)
add_subdirectory(notesagent)
......
......@@ -21,7 +21,9 @@ ecm_qt_declare_logging_category(notesagent_SRCS HEADER notesagent_debug.h IDENTI
)
add_executable(akonadi_notes_agent ${notesagent_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(akonadi_notes_agent PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(akonadi_notes_agent
KF5::AkonadiCore
KF5::Mime
......
......@@ -61,6 +61,10 @@ kconfig_add_kcfg_files(libnoteshared_kcfg_lib_SRCS ${libnoteshared_kcfg_lib_SRCS
add_library(notesharedprivate ${libnoteshared_SRCS} ${libnoteshared_kcfg_lib_SRCS} )
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(notesharedprivate PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(notesharedprivate BASE_NAME noteshared)
target_link_libraries(notesharedprivate
......
......@@ -53,6 +53,10 @@ ecm_qt_declare_logging_category(libknotesprivate_lib_SRCS HEADER knotes_debug.h
)
add_library(knotesprivate ${libknotesprivate_lib_SRCS} ${libknotesprivate_kcfg_lib_SRCS} )
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(knotesprivate PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(knotesprivate BASE_NAME knotes)
target_link_libraries(knotesprivate
......@@ -90,6 +94,9 @@ file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-knotes.png")
ecm_add_app_icon(knotes_SRCS ICONS ${ICONS_SRCS})
add_executable(knotes ${knotes_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(knotes PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(knotes
knotesprivate
......
......@@ -25,7 +25,9 @@ ecm_qt_declare_logging_category(kontact_knotesplugin_PART_SRCS HEADER knotes_kon
add_library(kontact_knotesplugin MODULE ${kontact_knotesplugin_PART_SRCS} ${kontact_knotesplugin_interface_SRCS} )
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kontact_knotesplugin PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kontact_knotesplugin
knotesprivate
KF5::CalendarCore
......
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