Commit 0096bdd0 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 72b32991
Pipeline #44086 passed with stage
in 8 minutes and 39 seconds
......@@ -47,7 +47,16 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KLDAP
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5LdapConfigVersion.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()
########### Find packages ###########
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -77,7 +77,9 @@ ecm_qt_declare_logging_category(kldap_LIB_SRCS HEADER ldapclient_debug.h IDENTIF
add_library(KF5Ldap ${kldap_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5Ldap PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5Ldap BASE_NAME kldap)
add_library(KF5::Ldap ALIAS KF5Ldap)
......
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