Commit 48311aa3 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 15b33abc
Pipeline #44159 passed with stage
in 5 minutes and 43 seconds
......@@ -60,6 +60,17 @@ add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
add_definitions(-DQT_NO_EMIT)
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)
if (KGAPI_BUILD_EXAMPLES)
......
......@@ -24,6 +24,10 @@ set_source_files_properties(
endif()
add_library(kgapitest STATIC ${kgapitest_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kgapitest PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kgapitest Qt5::Core Qt5::Network Qt5::Gui Qt5::Test KPimGAPICore)
......
......@@ -51,10 +51,14 @@ ecm_generate_headers(kgapiblogger_CamelCase_HEADERS
add_library(KPimGAPIBlogger
${kgapiblogger_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPIBlogger PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPIBlogger BASE_NAME kgapiblogger)
add_library(KPim::GAPIBlogger ALIAS KPimGAPIBlogger)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPIBlogger ALIAS KPimGAPIBlogger)
target_include_directories(KPimGAPIBlogger INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
......@@ -41,9 +41,13 @@ add_library(KPimGAPICalendar
${kgapicalendar_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPICalendar PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPICalendar BASE_NAME kgapicalendar)
add_library(KPim::GAPICalendar ALIAS KPimGAPICalendar)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPICalendar ALIAS KPimGAPICalendar)
target_include_directories(KPimGAPICalendar INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
......@@ -35,10 +35,14 @@ ecm_generate_headers(kgapicontacts_CamelCase_HEADERS
add_library(KPimGAPIContacts
${kgapicontacts_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPIContacts PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPIContacts BASE_NAME kgapicontacts)
add_library(KPim::GAPIContacts ALIAS KPimGAPIContacts)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPIContacts ALIAS KPimGAPIContacts)
target_include_directories(KPimGAPIContacts INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
......@@ -52,10 +52,14 @@ ecm_generate_headers(kgapicore_accountinfo_CamelCase_HEADERS
add_library(KPimGAPICore
${kgapicore_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPICore PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPICore BASE_NAME kgapicore)
add_library(KPim::GAPICore ALIAS KPimGAPICore)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPICore ALIAS KPimGAPICore)
target_include_directories(KPimGAPICore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI;${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI/kgapi>")
......
......@@ -123,6 +123,10 @@ ecm_generate_headers(kgapidrive_CamelCase_HEADERS
add_library(KPimGAPIDrive
${kgapidrive_SRCS}
)
#Disable for the moment
#if (COMPILE_WITH_CMAKE_SUPPORT)
# set_target_properties(KPimGAPIDrive PROPERTIES UNITY_BUILD ON)
#endif()
generate_export_header(KPimGAPIDrive BASE_NAME kgapidrive)
......
......@@ -25,10 +25,14 @@ ecm_generate_headers(kgapilatitude_CamelCase_HEADERS
add_library(KPimGAPILatitude
${kgapilatitude_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPILatitude PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPILatitude BASE_NAME kgapilatitude)
add_library(KPim::GAPILatitude ALIAS KPimGAPILatitude)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPILatitude ALIAS KPimGAPILatitude)
target_include_directories(KPimGAPILatitude INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
......@@ -20,10 +20,14 @@ ecm_generate_headers(kgapimaps_CamelCase_HEADERS
add_library(KPimGAPIMaps
${kgapimaps_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPIMaps PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPIMaps BASE_NAME kgapimaps)
add_library(KPim::GAPIMaps ALIAS KPimGAPIMaps)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPIMaps ALIAS KPimGAPIMaps)
target_include_directories(KPimGAPIMaps INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
......@@ -35,10 +35,14 @@ ecm_generate_headers(kgapitasks_CamelCase_HEADERS
add_library(KPimGAPITasks
${kgapitasks_SRCS}
)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KPimGAPITasks PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KPimGAPITasks BASE_NAME kgapitasks)
add_library(KPim::GAPITasks ALIAS KPimGAPITasks)
# TODO: Backwards compatibility, remove in next major release
add_library(KF5::GAPITasks ALIAS KPimGAPITasks)
target_include_directories(KPimGAPITasks INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim/KGAPI>")
......
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