Commit 70bca94c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make compile with cmake UNITY support

parent b8a976fd
Pipeline #45875 passed with stage
in 10 minutes and 42 seconds
......@@ -112,6 +112,17 @@ add_definitions(-DQT_NO_KEYWORDS)
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KPimItinerary")
set(KDE_INSTALL_INCLUDEDIR_PIM ${KDE_INSTALL_INCLUDEDIR}/KPim)
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(src)
if(BUILD_TESTING)
add_subdirectory(autotests)
......
......@@ -97,6 +97,9 @@ ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER compare-logging.h IDE
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER validator-logging.h IDENTIFIER KItinerary::ValidatorLog CATEGORY_NAME org.kde.kitinerary.extractorValidator)
add_library(KPimItinerary ${kitinerary_lib_srcs})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimItinerary PROPERTIES UNITY_BUILD ON)
endif()
add_library(KPim::Itinerary ALIAS KPimItinerary)
generate_export_header(KPimItinerary BASE_NAME KItinerary)
set_target_properties(KPimItinerary PROPERTIES
......
......@@ -18,7 +18,6 @@ target_include_directories(generate-knowledgedb PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/..
)
target_link_libraries(generate-knowledgedb PRIVATE Qt5::Network Qt5::Gui KOSM)
# extract all elements we are interested in (airports, terminals, stations at airports)
osm_filter(OUTPUT airports.o5m FILTER --keep=\"iata=* or aeroway=terminal or public_transport=station or railway=station or railway=halt or railway=tram_stop\")
......
......@@ -526,7 +526,7 @@ static Ticket mergeValue(const Ticket &lhs, const Ticket &rhs)
return t;
}
static bool valueIsNull(const QVariant &v)
static bool checkValueIsNull(const QVariant &v)
{
if (v.type() == qMetaTypeId<float>()) {
return std::isnan(v.toFloat());
......@@ -580,7 +580,7 @@ QVariant MergeUtil::merge(const QVariant &lhs, const QVariant &rhs)
rv = merge(prop.readOnGadget(lhs.constData()), rv);
}
if (!valueIsNull(rv)) {
if (!checkValueIsNull(rv)) {
prop.writeOnGadget(res.data(), rv);
}
}
......
......@@ -7,3 +7,6 @@ add_library(KOSM STATIC
target_include_directories(KOSM PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>")
target_link_libraries(KOSM PUBLIC Qt5::Core)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KOSM PROPERTIES UNITY_BUILD ON)
endif()
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