Commit d03f98e7 authored by Harald Sitter's avatar Harald Sitter 🦄

make servicerunner only build once

Summary:
build the runner itself in a static lib we can use for testing and then
link that into a module lib together with the factory entry point to
compose the final lib for installation

means servicesrunner.cpp is now only built once, whereas before it was
built twice through 100% duplicative targets

Test Plan: test still passes, installing and restarting krunner still yields working service searches

Reviewers: broulik, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28137
parent d8d079e4
......@@ -10,8 +10,8 @@ ecm_qt_declare_logging_category(krunner_services_SRCS
CATEGORY_NAME org.kde.plasma.runner.services
DEFAULT_SEVERITY Warning)
add_library(krunner_services MODULE ${krunner_services_SRCS})
target_link_libraries(krunner_services
add_library(krunner_services_static STATIC ${krunner_services_SRCS})
target_link_libraries(krunner_services_static
KF5::CoreAddons
KF5::KIOWidgets
KF5::I18n
......@@ -20,18 +20,12 @@ target_link_libraries(krunner_services
KF5::Activities
)
add_library(krunner_services_test STATIC ${krunner_services_SRCS})
target_link_libraries(krunner_services_test
KF5::CoreAddons
KF5::KIOWidgets
KF5::I18n
KF5::Runner
KF5::Service
KF5::Activities
add_library(krunner_services MODULE plugin.cpp)
target_link_libraries(krunner_services
krunner_services_static
)
install(TARGETS krunner_services DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS krunner_services DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES plasma-runner-services.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
if(BUILD_TESTING)
......
......@@ -3,4 +3,4 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
include(ECMAddTests)
ecm_add_test(servicerunnertest.cpp TEST_NAME servicerunnertest
LINK_LIBRARIES Qt5::Test krunner_services_test)
LINK_LIBRARIES Qt5::Test krunner_services_static)
/*
* Copyright (C) 2006 Aaron Seigo <aseigo@kde.org>
* Copyright (C) 2014 Vishesh Handa <vhanda@kde.org>
* Copyright (C) 2016 Harald Sitter <sitter@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "servicerunner.h"
K_EXPORT_PLASMA_RUNNER(services, ServiceRunner)
#include "plugin.moc"
......@@ -465,7 +465,3 @@ QMimeData * ServiceRunner::mimeDataForMatch(const Plasma::QueryMatch &match)
data->setUrls(QList<QUrl>{QUrl::fromLocalFile(path)});
return data;
}
K_EXPORT_PLASMA_RUNNER(services, ServiceRunner)
#include "servicerunner.moc"
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