Commit 2f5fed25 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 d947b05c
Pipeline #44119 passed with stage
in 7 minutes and 54 seconds
......@@ -42,7 +42,16 @@ add_definitions(-DQT_NO_FOREACH)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
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)
......
......@@ -11,11 +11,13 @@ ecm_qt_declare_logging_category(kmbox_SRCS HEADER kmbox_debug.h IDENTIFIER KMBOX
add_library(KF5Mbox ${kmbox_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5Mbox PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5Mbox BASE_NAME kmbox)
add_library(KF5::Mbox ALIAS KF5Mbox)
target_include_directories(KF5Mbox INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KMbox>")
target_include_directories(KF5Mbox PUBLIC "$<BUILD_INTERFACE:${KMbox_SOURCE_DIR}/src;${KMbox_BINARY_DIR}/src>")
......
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