Commit 560e4ce3 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 976d934b
Pipeline #44118 passed with stage
in 9 minutes
......@@ -56,7 +56,16 @@ add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
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()
########### Targets ###########
add_subdirectory(src)
......
......@@ -26,7 +26,9 @@ ki18n_wrap_ui(kcalutils_SRCS recurrenceactionsscopewidget.ui)
qt5_add_resources(kcalutils_SRCS templates.qrc)
add_library(KF5CalendarUtils ${kcalutils_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5CalendarUtils PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5CalendarUtils BASE_NAME kcalutils)
add_library(KF5::CalendarUtils ALIAS KF5CalendarUtils)
......
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