Commit a26c6c5f authored by Harald Sitter's avatar Harald Sitter 💎

make convertrunner only build once

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

same as https://phabricator.kde.org/D28137
parent c6be0e20
......@@ -2,15 +2,8 @@ add_definitions(-DTRANSLATION_DOMAIN=\"plasma_runner_converterrunner\")
set(krunner_converter_SRCS converterrunner.cpp)
add_library(krunner_converter MODULE ${krunner_converter_SRCS})
target_link_libraries(krunner_converter KF5::UnitConversion KF5::I18n KF5::Runner Qt5::Widgets)
install(TARGETS krunner_converter DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES plasma-runner-converter.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
add_library(krunner_converter_test STATIC ${krunner_converter_SRCS})
target_link_libraries(krunner_converter_test
add_library(krunner_converter_static STATIC ${krunner_converter_SRCS})
target_link_libraries(krunner_converter_static
KF5::I18n
KF5::Runner
KF5::UnitConversion
......@@ -18,6 +11,12 @@ target_link_libraries(krunner_converter_test
Qt5::Test
)
add_library(krunner_converter MODULE plugin.cpp)
target_link_libraries(krunner_converter krunner_converter_static)
install(TARGETS krunner_converter DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES plasma-runner-converter.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
......@@ -2,4 +2,4 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
include(ECMAddTests)
ecm_add_test(converterrunnertest.cpp TEST_NAME converterrunnertest LINK_LIBRARIES Qt5::Test krunner_converter_test)
ecm_add_test(converterrunnertest.cpp TEST_NAME converterrunnertest LINK_LIBRARIES Qt5::Test krunner_converter_static)
......@@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "converterrunner.h"
#include <QGuiApplication>
......@@ -27,8 +26,6 @@
#include <cmath>
K_EXPORT_PLASMA_RUNNER(converterrunner, ConverterRunner)
ConverterRunner::ConverterRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
{
......@@ -262,5 +259,3 @@ void ConverterRunner::insertCompatibleUnits()
}
}
}
#include "converterrunner.moc"
/*
* Copyright (C) 2007,2008 Petri Damstén <damu@iki.fi>
* Copyright (C) 2020 Alexander Lohnau <alexander.lohnau@gmx.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "converterrunner.h"
K_EXPORT_PLASMA_RUNNER(converterrunner, ConverterRunner)
#include "plugin.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