Commit 4216c7e6 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Move non-exported code to a static library

This allows us to speed up the compilation because we don't need to
build twice the source files we use in the unit tests.

Test Plan: Builds, dolphin works and tests pass.

Reviewers: emmanuelp, dfaure

Differential Revision: https://phabricator.kde.org/D5935
parent 4d9c396a
...@@ -193,7 +193,7 @@ install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}) ...@@ -193,7 +193,7 @@ install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
########################################## ##########################################
set(dolphin_SRCS set(dolphinstatic_SRCS
dolphindockwidget.cpp dolphindockwidget.cpp
dolphinmainwindow.cpp dolphinmainwindow.cpp
dolphinviewcontainer.cpp dolphinviewcontainer.cpp
...@@ -248,11 +248,10 @@ set(dolphin_SRCS ...@@ -248,11 +248,10 @@ set(dolphin_SRCS
statusbar/statusbarspaceinfo.cpp statusbar/statusbarspaceinfo.cpp
views/zoomlevelinfo.cpp views/zoomlevelinfo.cpp
dolphindebug.cpp dolphindebug.cpp
dbusinterface.cpp
global.cpp global.cpp
) )
kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
panels/folders/dolphin_folderspanelsettings.kcfgc panels/folders/dolphin_folderspanelsettings.kcfgc
panels/information/dolphin_informationpanelsettings.kcfgc panels/information/dolphin_informationpanelsettings.kcfgc
panels/places/dolphin_placespanelsettings.kcfgc panels/places/dolphin_placespanelsettings.kcfgc
...@@ -265,36 +264,44 @@ kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC ...@@ -265,36 +264,44 @@ kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
) )
if(NOT WIN32) if(NOT WIN32)
set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp) set(dolphinstatic_SRCS ${dolphinstatic_SRCS} panels/terminal/terminalpanel.cpp)
endif() endif()
# Sets the icon on Windows and OSX add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES}) target_include_directories(dolphinstatic PRIVATE ${PHONON_INCLUDES})
target_link_libraries(dolphinstatic
target_link_libraries(kdeinit_dolphin
dolphinprivate dolphinprivate
KF5::Parts
KF5::KCMUtils KF5::KCMUtils
KF5::Solid
KF5::CoreAddons
KF5::DBusAddons KF5::DBusAddons
KF5::Bookmarks
KF5::Notifications KF5::Notifications
Phonon::phonon4qt5 Phonon::phonon4qt5
) )
if (KF5Activities_FOUND) if (KF5Activities_FOUND)
target_link_libraries( target_link_libraries(
kdeinit_dolphin dolphinstatic
KF5::Activities KF5::Activities
) )
endif() endif()
set(dolphin_SRCS
dbusinterface.cpp
main.cpp
)
# Sets the icon on Windows and OSX
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
target_link_libraries(kdeinit_dolphin
dolphinstatic
dolphinprivate
)
include(DbusInterfaceMacros) include(DbusInterfaceMacros)
generate_and_install_dbus_interface( generate_and_install_dbus_interface(
......
...@@ -14,35 +14,22 @@ ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test) ...@@ -14,35 +14,22 @@ ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test) ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
# KItemListControllerTest # KItemListControllerTest
ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp
kconfig_add_kcfg_files(kitemlistcontrollertest_SRCS GENERATE_MOC
../settings/dolphin_generalsettings.kcfgc
)
ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp ../dolphindebug.cpp ${kitemlistcontrollertest_SRCS}
TEST_NAME kitemlistcontrollertest TEST_NAME kitemlistcontrollertest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate Qt5::Test)
# KFileItemListViewTest # KFileItemListViewTest
kconfig_add_kcfg_files(kfileitemlistviewtest_SRCS GENERATE_MOC ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp
../settings/dolphin_generalsettings.kcfgc
)
ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemlistviewtest_SRCS}
TEST_NAME kfileitemlistviewtest TEST_NAME kfileitemlistviewtest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate Qt5::Test)
# KFileItemModelTest # KFileItemModelTest
kconfig_add_kcfg_files(kfileitemmodeltest_SRCS GENERATE_MOC ecm_add_test(kfileitemmodeltest.cpp testdir.cpp
../settings/dolphin_generalsettings.kcfgc
)
ecm_add_test(kfileitemmodeltest.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodeltest_SRCS}
TEST_NAME kfileitemmodeltest TEST_NAME kfileitemmodeltest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
# KFileItemModelBenchmark # KFileItemModelBenchmark
kconfig_add_kcfg_files(kfileitemmodelbenchmark_SRCS GENERATE_MOC ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp
../settings/dolphin_generalsettings.kcfgc
)
ecm_add_test(kfileitemmodelbenchmark.cpp testdir.cpp ../dolphindebug.cpp ${kfileitemmodelbenchmark_SRCS}
TEST_NAME kfileitemmodelbenchmark TEST_NAME kfileitemmodelbenchmark
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate Qt5::Test)
...@@ -51,24 +38,17 @@ ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivat ...@@ -51,24 +38,17 @@ ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivat
# DolphinSearchBox # DolphinSearchBox
if (KF5Baloo_FOUND) if (KF5Baloo_FOUND)
kconfig_add_kcfg_files(dolphinsearchboxtest_SRCS ecm_add_test(dolphinsearchboxtest.cpp
../search/dolphin_searchsettings.kcfgc
)
ecm_add_test(dolphinsearchboxtest.cpp ../search/dolphinfacetswidget.cpp ../search/dolphinsearchbox.cpp ${dolphinsearchboxtest_SRCS}
TEST_NAME dolphinsearchboxtest TEST_NAME dolphinsearchboxtest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
endif() endif()
# KStandardItemModelTest # KStandardItemModelTest
ecm_add_test(kstandarditemmodeltest.cpp ../dolphindebug.cpp ecm_add_test(kstandarditemmodeltest.cpp
TEST_NAME kstandarditemmodeltest TEST_NAME kstandarditemmodeltest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
# ViewPropertiesTest # ViewPropertiesTest
kconfig_add_kcfg_files(viewpropertiestest_SRCS GENERATE_MOC ecm_add_test(viewpropertiestest.cpp testdir.cpp
../settings/dolphin_generalsettings.kcfgc
../settings/dolphin_directoryviewpropertysettings.kcfgc
)
ecm_add_test(viewpropertiestest.cpp testdir.cpp ../dolphindebug.cpp ${viewpropertiestest_SRCS}
TEST_NAME viewpropertiestest TEST_NAME viewpropertiestest
LINK_LIBRARIES dolphinprivate Qt5::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
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