Commit 845047eb 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 3d9e40d2
Pipeline #44156 passed with stage
in 9 minutes and 35 seconds
......@@ -76,7 +76,16 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DTRANSLATION_DOMAIN=\"kontact\")
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()
add_subdirectory(src)
add_subdirectory(kconf_update)
......
......@@ -27,6 +27,10 @@ kconfig_add_kcfg_files(kontactprivate_LIB_SRCS prefs.kcfgc)
qt5_add_resources(kontactprivate_LIB_SRCS kontact.qrc)
add_library(kontactprivate ${kontactprivate_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kontactprivate PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(kontactprivate BASE_NAME kontact)
target_link_libraries(kontactprivate
......@@ -68,6 +72,9 @@ target_link_libraries(kontact_bin
KF5::KontactInterface
KF5::Crash
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kontact_bin PROPERTIES UNITY_BUILD ON)
endif()
install(TARGETS kontact_bin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
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