Commit 7f33a350 authored by Laurent Montel's avatar Laurent Montel 😁

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 cafaa856
Pipeline #44121 passed with stage
in 7 minutes and 51 seconds
...@@ -61,7 +61,16 @@ add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00) ...@@ -61,7 +61,16 @@ add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
add_definitions(-DQT_NO_FOREACH) add_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_NO_KEYWORDS)
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 ########### ########### Targets ###########
add_subdirectory(src) add_subdirectory(src)
......
...@@ -13,7 +13,9 @@ ecm_qt_declare_logging_category(ksmtp_SRCS HEADER ksmtp_debug.h ...@@ -13,7 +13,9 @@ ecm_qt_declare_logging_category(ksmtp_SRCS HEADER ksmtp_debug.h
) )
add_library(KPimSMTP ${ksmtp_SRCS}) add_library(KPimSMTP ${ksmtp_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimSMTP PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimSMTP BASE_NAME ksmtp) generate_export_header(KPimSMTP BASE_NAME ksmtp)
add_library(KPim::SMTP ALIAS KPimSMTP) add_library(KPim::SMTP ALIAS KPimSMTP)
......
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