Commit d22c41c5 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 66e6b835
Pipeline #44263 passed with stage
in 10 minutes and 33 seconds
......@@ -66,6 +66,17 @@ if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_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_UNITY_CMAKE_SUPPORT true)
endif()
endif()
########### Targets ###########
add_subdirectory(src)
......
......@@ -46,6 +46,9 @@ add_library(KF5MailTransport
${mailtransport_widgets_srcs}
${mailtransport_plugins_srcs}
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5MailTransport PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5MailTransport BASE_NAME mailtransport)
......
......@@ -28,7 +28,9 @@ ecm_qt_declare_logging_category(mailtransportakonadi_lib_srcs HEADER mailtranspo
add_library(KF5MailTransportAkonadi ${mailtransportakonadi_lib_srcs}
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5MailTransportAkonadi PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5MailTransportAkonadi BASE_NAME mailtransportakonadi)
add_library(KF5::MailTransportAkonadi ALIAS KF5MailTransportAkonadi)
......
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