Skip to content

Commit

Permalink
Move the launcher core library into its own folder too
Browse files Browse the repository at this point in the history
Now we have one target per folder, which makes it a lot easier to reason
about dependencies here.
  • Loading branch information
vkrause committed Apr 4, 2017
1 parent 284b8c6 commit d4b3eed
Show file tree
Hide file tree
Showing 75 changed files with 147 additions and 148 deletions.
4 changes: 2 additions & 2 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include <common/paths.h>

#include <launcher/launcher.h>
#include <launcher/launchoptions.h>
#include <launcher/core/launcher.h>
#include <launcher/core/launchoptions.h>
#include <launcher/ui/launcherwindow.h>

#include <client/clientconnectionmanager.h>
Expand Down
99 changes: 1 addition & 98 deletions launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,103 +1,6 @@
add_subdirectory(injector)

if(NOT GAMMARAY_PROBE_ONLY_BUILD)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)

# shared launcher code
set(gammaray_launcher_shared_srcs
injector/abstractinjector.cpp
injector/processinjector.cpp
injector/injectorfactory.cpp
injector/styleinjector.cpp

libraryutil.cpp
probeabi.cpp
probeabidetector.cpp
probefinder.cpp
launchoptions.cpp
networkdiscoverymodel.cpp
clientlauncher.cpp
launcherfinder.cpp
launcher.cpp
selftest.cpp
)

if(WIN32)
list(APPEND gammaray_launcher_shared_srcs
probeabidetector_win.cpp
pefile.cpp
injector/windllinjector.cpp
)
else()
list(APPEND gammaray_launcher_shared_srcs
injector/debuggerinjector.cpp
injector/gdbinjector.cpp
injector/lldbinjector.cpp
injector/preloadcheck.cpp
injector/preloadinjector.cpp
)
if(APPLE)
list(APPEND gammaray_launcher_shared_srcs probeabidetector_mac.cpp)
elseif(UNIX)
list(APPEND gammaray_launcher_shared_srcs probeabidetector_elf.cpp)
else()
list(APPEND gammaray_launcher_shared_srcs probeabidetector_dummy.cpp)
endif()
endif()

add_library(gammaray_launcher SHARED ${gammaray_launcher_shared_srcs})
generate_export_header(gammaray_launcher)
set_target_properties(gammaray_launcher PROPERTIES
${GAMMARAY_DEFAULT_LIBRARY_PROPERTIES}
)

gammaray_target_relocatable_interfaces(gammaray_launcher_ipaths)
target_include_directories(gammaray_launcher PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:${gammaray_launcher_ipaths}>)
target_link_libraries(gammaray_launcher LINK_PUBLIC ${QT_QTCORE_LIBRARIES} LINK_PRIVATE gammaray_common ${QT_QTNETWORK_LIBRARIES})
if(HAVE_QT_WIDGETS)
target_link_libraries(gammaray_launcher LINK_PRIVATE ${QT_QTGUI_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(gammaray_launcher LINK_PRIVATE version)
elseif(APPLE)
target_link_libraries(gammaray_launcher LINK_PRIVATE "-framework CoreFoundation")
endif()
if(UNIX AND NOT APPLE AND NOT QNXNTO)
target_link_libraries(gammaray_launcher LINK_PRIVATE dl) # for preload check
endif()

if(NOT GAMMARAY_PROBE_ONLY_BUILD)
install(TARGETS gammaray_launcher EXPORT GammaRayTargets ${INSTALL_TARGETS_DEFAULT_ARGS})

gammaray_install_headers(
${CMAKE_CURRENT_BINARY_DIR}/gammaray_launcher_export.h
launcher.h
launchoptions.h
probeabi.h
probeabidetector.h
probefinder.h
networkdiscoverymodel.h
)

ecm_generate_pri_file(BASE_NAME GammaRayLauncher
LIB_NAME gammaray_launcher
DEPS "core gui GammaRayCommon"
FILENAME_VAR PRI_FILENAME
INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}
)

install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
else()
install(TARGETS gammaray_launcher ${INSTALL_TARGETS_DEFAULT_ARGS})
endif()
if(MSVC)
install(FILES "$<TARGET_PDB_FILE_DIR:gammaray_launcher>/$<TARGET_PDB_FILE_NAME:gammaray_launcher>" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo)
endif()

add_subdirectory(core)
add_subdirectory(cli)
# UI launcher
if(HAVE_QT_CONCURRENT AND GAMMARAY_BUILD_UI)
add_subdirectory(ui)
add_subdirectory(app)
Expand Down
7 changes: 4 additions & 3 deletions launcher/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
*/

#include <config-gammaray.h>
#include "launcherwindow.h"
#include "launchoptions.h"
#include "launcherfinder.h"

#include <launcher/ui/launcherwindow.h>
#include <launcher/core/launchoptions.h>
#include <launcher/core/launcherfinder.h>

#include <common/paths.h>
#include <common/translator.h>
Expand Down
19 changes: 10 additions & 9 deletions launcher/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@

#include <config-gammaray.h>
#include "config-gammaray-version.h"
#include "injector/injectorfactory.h"
#include "clientlauncher.h"
#include "launchoptions.h"
#include "launcherfinder.h"
#include "launcher.h"
#include "probefinder.h"
#include "selftest.h"

#include <launcher/core/injector/injectorfactory.h>
#include <launcher/core/clientlauncher.h>
#include <launcher/core/launchoptions.h>
#include <launcher/core/launcherfinder.h>
#include <launcher/core/launcher.h>
#include <launcher/core/probeabi.h>
#include <launcher/core/probeabidetector.h>
#include <launcher/core/probefinder.h>
#include <launcher/core/selftest.h>

#include <common/paths.h>
#include <common/protocol.h>
#include <launcher/probeabi.h>
#include <launcher/probeabidetector.h>

#ifdef HAVE_QT_WIDGETS
#include <QApplication>
Expand Down
91 changes: 91 additions & 0 deletions launcher/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
add_subdirectory(injector)

set(gammaray_launcher_shared_srcs
injector/abstractinjector.cpp
injector/processinjector.cpp
injector/injectorfactory.cpp
injector/styleinjector.cpp

libraryutil.cpp
probeabi.cpp
probeabidetector.cpp
probefinder.cpp
launchoptions.cpp
networkdiscoverymodel.cpp
clientlauncher.cpp
launcherfinder.cpp
launcher.cpp
selftest.cpp
)

if(WIN32)
list(APPEND gammaray_launcher_shared_srcs
probeabidetector_win.cpp
pefile.cpp
injector/windllinjector.cpp
)
else()
list(APPEND gammaray_launcher_shared_srcs
injector/debuggerinjector.cpp
injector/gdbinjector.cpp
injector/lldbinjector.cpp
injector/preloadcheck.cpp
injector/preloadinjector.cpp
)
if(APPLE)
list(APPEND gammaray_launcher_shared_srcs probeabidetector_mac.cpp)
elseif(UNIX)
list(APPEND gammaray_launcher_shared_srcs probeabidetector_elf.cpp)
else()
list(APPEND gammaray_launcher_shared_srcs probeabidetector_dummy.cpp)
endif()
endif()

add_library(gammaray_launcher SHARED ${gammaray_launcher_shared_srcs})
generate_export_header(gammaray_launcher)
set_target_properties(gammaray_launcher PROPERTIES
${GAMMARAY_DEFAULT_LIBRARY_PROPERTIES}
)

gammaray_target_relocatable_interfaces(gammaray_launcher_ipaths)
target_include_directories(gammaray_launcher PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:${gammaray_launcher_ipaths}>)
target_link_libraries(gammaray_launcher LINK_PUBLIC ${QT_QTCORE_LIBRARIES} LINK_PRIVATE gammaray_common ${QT_QTNETWORK_LIBRARIES})
if(HAVE_QT_WIDGETS)
target_link_libraries(gammaray_launcher LINK_PRIVATE ${QT_QTGUI_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(gammaray_launcher LINK_PRIVATE version)
elseif(APPLE)
target_link_libraries(gammaray_launcher LINK_PRIVATE "-framework CoreFoundation")
endif()
if(UNIX AND NOT APPLE AND NOT QNXNTO)
target_link_libraries(gammaray_launcher LINK_PRIVATE dl) # for preload check
endif()

if(NOT GAMMARAY_PROBE_ONLY_BUILD)
install(TARGETS gammaray_launcher EXPORT GammaRayTargets ${INSTALL_TARGETS_DEFAULT_ARGS})

gammaray_install_headers(DESTINATION launcher
${CMAKE_CURRENT_BINARY_DIR}/gammaray_launcher_export.h
launcher.h
launchoptions.h
probeabi.h
probeabidetector.h
probefinder.h
networkdiscoverymodel.h
)

ecm_generate_pri_file(BASE_NAME GammaRayLauncher
LIB_NAME gammaray_launcher
DEPS "core gui GammaRayCommon"
FILENAME_VAR PRI_FILENAME
INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}
)

install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
else()
install(TARGETS gammaray_launcher ${INSTALL_TARGETS_DEFAULT_ARGS})
endif()
if(MSVC)
install(FILES "$<TARGET_PDB_FILE_DIR:gammaray_launcher>/$<TARGET_PDB_FILE_NAME:gammaray_launcher>" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef GAMMARAY_ABSTRACTINJECTOR_H
#define GAMMARAY_ABSTRACTINJECTOR_H

#include <launcher/probeabi.h>
#include <launcher/core/probeabi.h>

#include <QProcess>
#include <QSharedPointer>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "preloadinjector.h"
#endif

#include <launcher/probeabi.h>
#include <launcher/core/probeabi.h>

#include <QString>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions launcher/ui/attachdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

#include <config-gammaray.h>
#include "attachdialog.h"

#include "launchoptions.h"
#include "processfiltermodel.h"
#include "processmodel.h"
#include "probeabimodel.h"

#include <launcher/core/launchoptions.h>

#include <ui/searchlinecontroller.h>

#include <QPushButton>
Expand Down
5 changes: 3 additions & 2 deletions launcher/ui/connectpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@

#include "connectpage.h"
#include "ui_connectpage.h"
#include "networkdiscoverymodel.h"
#include "clientlauncher.h"

#include <launcher/core/networkdiscoverymodel.h>
#include <launcher/core/clientlauncher.h>

#include <common/endpoint.h>

Expand Down
3 changes: 2 additions & 1 deletion launcher/ui/launcherwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

#include "launcherwindow.h"
#include "ui_launcherwindow.h"
#include "launchoptions.h"

#include <launcher/core/launchoptions.h>

#include <ui/aboutdata.h>
#include <ui/helpcontroller.h>
Expand Down
5 changes: 3 additions & 2 deletions launcher/ui/launchpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
#include <config-gammaray.h>
#include "launchpage.h"
#include "ui_launchpage.h"
#include "launchoptions.h"
#include "probefinder.h"
#include "probeabimodel.h"

#include <launcher/core/launchoptions.h>
#include <launcher/core/probefinder.h>

#include <QCompleter>
#include <QFileDialog>
#include <QFileSystemModel>
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/launchpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef GAMMARAY_LAUNCHPAGE_H
#define GAMMARAY_LAUNCHPAGE_H

#include <launcher/probeabidetector.h>
#include <launcher/core/probeabidetector.h>

#include <QWidget>

Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/probeabimodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "probeabimodel.h"

#include <probefinder.h>
#include <launcher/core/probefinder.h>

using namespace GammaRay;

Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/probeabimodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef GAMMARAY_PROBEABIMODEL_H
#define GAMMARAY_PROBEABIMODEL_H

#include <launcher/probeabi.h>
#include <launcher/core/probeabi.h>

#include <QAbstractListModel>
#include <QVector>
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/processlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef GAMMARAY_PROCESSLIST_H
#define GAMMARAY_PROCESSLIST_H

#include <launcher/probeabi.h>
#include <launcher/core/probeabi.h>

#include <QString>
#include <QList>
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/processlist_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "processlist.h"

#include <launcher/probeabidetector.h>
#include <launcher/core/probeabidetector.h>

#include <QProcess>
#include <QDir>
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/processlist_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "processlist.h"

#include <launcher/probeabidetector.h>
#include <launcher/core/probeabidetector.h>

#include <QLibrary>

Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/processmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "processmodel.h"
#include "probeabimodel.h"

#include <probefinder.h>
#include <launcher/core/probefinder.h>

#include <QDebug>

Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/processmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef GAMMARAY_PROCESSMODEL_H
#define GAMMARAY_PROCESSMODEL_H

#include <launcher/probeabi.h>
#include <launcher/core/probeabi.h>

#include <QAbstractTableModel>
#include <QVector>
Expand Down
Loading

0 comments on commit d4b3eed

Please sign in to comment.