Commit e105d01c 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 a85bb9eb
Pipeline #44090 passed with stage
in 12 minutes and 12 seconds
......@@ -61,6 +61,15 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
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()
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarSupport")
......
......@@ -54,6 +54,9 @@ ecm_qt_declare_logging_category(calendarsupport_LIB_SRCS HEADER calendarsupport_
kconfig_add_kcfg_files(calendarsupport_LIB_SRCS kcalprefs_base.kcfgc)
add_library(KF5CalendarSupport ${calendarsupport_LIB_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5CalendarSupport PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5CalendarSupport BASE_NAME calendarsupport)
add_library(KF5::CalendarSupport ALIAS KF5CalendarSupport)
......
......@@ -3,6 +3,9 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
########### next target ###############
add_executable(noteeditdialogtest noteeditdialogtest.cpp)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(noteeditdialogtest PROPERTIES UNITY_BUILD ON)
endif()
add_test(NAME noteeditdialogtest COMMAND noteeditdialogtest)
ecm_mark_as_test(noteeditdialogtest)
target_link_libraries(noteeditdialogtest
......
......@@ -27,7 +27,7 @@
using namespace CalendarSupport;
static QString cleanStr(const QString &instr)
static QString cleanString(const QString &instr)
{
QString ret = instr;
return ret.replace(QLatin1Char('\n'), QLatin1Char(' '));
......@@ -891,10 +891,10 @@ void CalPrintDay::print(QPainter &p, int width, int height)
count++;
QString str;
if (event->location().isEmpty()) {
str = cleanStr(event->summary());
str = cleanString(event->summary());
} else {
str = i18nc("summary, location", "%1, %2",
cleanStr(event->summary()), cleanStr(event->location()));
cleanString(event->summary()), cleanString(event->location()));
}
printEventString(p, eventBox, str);
eventBox.setTop(eventBox.bottom());
......
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