Commit 584a69c6 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) (disable for the moment)
parent bf91934c
Pipeline #44335 passed with stage
in 12 minutes and 8 seconds
......@@ -83,7 +83,16 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
configure_file(grantleeeditor-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/grantleeeditor-version.h @ONLY)
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_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_UNITY_CMAKE_SUPPORT true)
endif()
endif()
add_subdirectory(headerthemeeditor)
add_subdirectory(contactthemeeditor)
add_subdirectory(grantleethemeeditor)
......
......@@ -20,6 +20,10 @@ ecm_qt_declare_logging_category(contactprintthemeeditor_SRCS HEADER contactprint
qt5_add_resources(contactprintthemeeditor_SRCS contactprintthemeeditor.qrc)
add_executable(contactprintthemeeditor ${contactprintthemeeditor_SRCS} )
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(contactprintthemeeditor PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(contactprintthemeeditor
Qt5::WebEngineWidgets
KF5::DBusAddons
......
......@@ -32,6 +32,9 @@ target_link_libraries(contactthemeeditor
KF5::I18n
KF5::Crash
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(contactthemeeditor PROPERTIES UNITY_BUILD ON)
endif()
install(TARGETS contactthemeeditor ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -30,6 +30,10 @@ ecm_qt_declare_logging_category(libgrantleethemeeditor_SRCS HEADER grantleetheme
add_library(grantleethemeeditor ${libgrantleethemeeditor_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(grantleethemeeditor PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(grantleethemeeditor BASE_NAME grantleethemeeditor)
target_include_directories(grantleethemeeditor PUBLIC "$<BUILD_INTERFACE:${grantleeditor_SOURCE_DIR};${grantleethemeeditor_SOURCE_DIR};${grantleethemeeditor_BINAY_DIR}>")
......
......@@ -21,6 +21,10 @@ ecm_qt_declare_logging_category(headerthemeeditor_SRCS HEADER headerthemeeditor_
qt5_add_resources(headerthemeeditor_SRCS headerthemeeditor.qrc)
add_executable(headerthemeeditor ${headerthemeeditor_SRCS} )
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(headerthemeeditor PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(headerthemeeditor
KF5::Mime
KF5::NewStuff
......
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