Commit ae575a4d 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 c5083ba3
Pipeline #44154 passed with stage
in 10 minutes and 25 seconds
......@@ -59,6 +59,17 @@ configure_package_config_file(
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
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)
......
......@@ -7,6 +7,9 @@ set(kimaptest_SRCS
)
add_library(kimaptest STATIC ${kimaptest_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kimaptest PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(kimaptest)
add_library(KF5::kimaptest ALIAS kimaptest)
target_link_libraries(kimaptest KF5IMAP Qt5::Test Qt5::Network Qt5::Core KF5::CoreAddons KF5::KIOCore KF5::I18n)
......
......@@ -56,6 +56,9 @@ ecm_qt_declare_logging_category(kimap_SRCS HEADER kimap_debug.h IDENTIFIER KIMAP
add_library(KF5IMAP ${kimap_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5IMAP PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5IMAP BASE_NAME kimap)
......
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