Commit 9d9e0957 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 e783f1c7
Pipeline #44085 passed with stage
in 12 minutes and 35 seconds
......@@ -61,6 +61,16 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX EVENTVIEWS
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfigVersion.cmake"
SOVERSION 5
)
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 ###########
......
......@@ -80,6 +80,9 @@ ki18n_wrap_ui(eventviews_LIB_SRCS
)
add_library(KF5EventViews ${eventviews_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5EventViews PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5EventViews BASE_NAME eventviews)
add_library(KF5::EventViews ALIAS KF5EventViews)
......
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