Commit 32a8d79e 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 0a84cccd
Pipeline #44126 passed with stage
in 9 minutes and 54 seconds
......@@ -61,7 +61,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()
if(BUILD_TESTING)
set(AKONADI_MIME_TEST_EXPORT AKONADI_MIME_EXPORT)
endif()
......
......@@ -66,7 +66,9 @@ install(FILES
)
add_library(KF5AkonadiMime ${akonadimime_SRCS})
if (COMPILE_WITH_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiMime PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5AkonadiMime BASE_NAME akonadi-mime)
add_library(KF5::AkonadiMime ALIAS KF5AkonadiMime)
......
......@@ -44,7 +44,7 @@ static const char s_specialCollectionTypes[SpecialMailCollections::LastType][11]
static const int s_numTypes = sizeof s_specialCollectionTypes / sizeof *s_specialCollectionTypes;
static inline QByteArray enumToType(SpecialMailCollections::Type value)
static inline QByteArray enumToByteArray(SpecialMailCollections::Type value)
{
return s_specialCollectionTypes[value];
}
......@@ -92,17 +92,17 @@ SpecialMailCollections *SpecialMailCollections::self()
bool SpecialMailCollections::hasCollection(Type type, const AgentInstance &instance) const
{
return SpecialCollections::hasCollection(enumToType(type), instance);
return SpecialCollections::hasCollection(enumToByteArray(type), instance);
}
Collection SpecialMailCollections::collection(Type type, const AgentInstance &instance) const
{
return SpecialCollections::collection(enumToType(type), instance);
return SpecialCollections::collection(enumToByteArray(type), instance);
}
bool SpecialMailCollections::registerCollection(Type type, const Collection &collection)
{
return SpecialCollections::registerCollection(enumToType(type), collection);
return SpecialCollections::registerCollection(enumToByteArray(type), collection);
}
bool SpecialMailCollections::unregisterCollection(const Collection &collection)
......@@ -116,12 +116,12 @@ bool SpecialMailCollections::unregisterCollection(const Collection &collection)
bool SpecialMailCollections::hasDefaultCollection(Type type) const
{
return SpecialCollections::hasDefaultCollection(enumToType(type));
return SpecialCollections::hasDefaultCollection(enumToByteArray(type));
}
Collection SpecialMailCollections::defaultCollection(Type type) const
{
return SpecialCollections::defaultCollection(enumToType(type));
return SpecialCollections::defaultCollection(enumToByteArray(type));
}
void SpecialMailCollections::verifyI18nDefaultCollection(Type type)
......
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