Commit cc74fd6b 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 87e430b0
Pipeline #44153 passed with stage
in 18 minutes and 36 seconds
......@@ -126,7 +126,16 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
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()
add_subdirectory(src)
......
......@@ -162,6 +162,10 @@ ecm_add_app_icon(kalarm_bin_SRCS ICONS ${ICONS_SRCS})
add_executable(kalarm_bin ${kalarm_bin_SRCS})
set_target_properties(kalarm_bin PROPERTIES OUTPUT_NAME kalarm)
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(kalarm_bin PROPERTIES UNITY_BUILD ON)
endif()
target_compile_definitions(kalarm_bin PRIVATE -DVERSION="${KALARM_VERSION}")
......
......@@ -225,8 +225,8 @@ void DisplayCalendar::updateKAEvents()
if (!cal)
return;
const Event::List kcalevents = cal->rawEvents();
for (const Event::Ptr& kcalevent : kcalevents)
const KCalendarCore::Event::List kcalevents = cal->rawEvents();
for (const KCalendarCore::Event::Ptr& kcalevent : kcalevents)
{
if (kcalevent->alarms().isEmpty())
continue; // ignore events without alarms
......@@ -258,7 +258,7 @@ bool DisplayCalendar::addEvent(KAEvent& evnt)
if (type != CalEvent::DISPLAYING)
return false;
Event::Ptr kcalEvent(new Event);
KCalendarCore::Event::Ptr kcalEvent(new KCalendarCore::Event);
auto* event = new KAEvent(evnt);
QString id = event->id();
if (id.isEmpty())
......@@ -304,7 +304,7 @@ bool DisplayCalendar::deleteEvent(const QString& eventID, bool saveit)
{
if (mOpen)
{
Event::Ptr kcalEvent;
KCalendarCore::Event::Ptr kcalEvent;
if (mCalendarStorage)
kcalEvent = mCalendarStorage->calendar()->event(eventID); // display calendar
......@@ -344,10 +344,10 @@ bool DisplayCalendar::deleteEvent(const QString& eventID, bool saveit)
* Return the event with the specified ID.
* This method is for the display calendar only.
*/
Event::Ptr DisplayCalendar::kcalEvent(const QString& uniqueID)
KCalendarCore::Event::Ptr DisplayCalendar::kcalEvent(const QString& uniqueID)
{
if (!mCalendarStorage)
return Event::Ptr();
return KCalendarCore::Event::Ptr();
return mCalendarStorage->calendar()->event(uniqueID);
}
......@@ -356,15 +356,15 @@ Event::Ptr DisplayCalendar::kcalEvent(const QString& uniqueID)
* This method is for the display calendar only.
* Optionally the event type can be filtered, using an OR of event types.
*/
Event::List DisplayCalendar::kcalEvents(CalEvent::Type type)
KCalendarCore::Event::List DisplayCalendar::kcalEvents(CalEvent::Type type)
{
Event::List list;
KCalendarCore::Event::List list;
if (!mCalendarStorage)
return list;
list = mCalendarStorage->calendar()->rawEvents();
for (int i = 0; i < list.count(); )
{
Event::Ptr event = list.at(i);
KCalendarCore::Event::Ptr event = list.at(i);
if (event->alarms().isEmpty()
|| (type != CalEvent::EMPTY && !(type & CalEvent::status(event)))
|| !KAEvent(event).isValid())
......
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