diff --git a/Source/Core/CMakeLists.txt b/Source/Core/CMakeLists.txt index 8c1ad903e9..5cd2ae2239 100644 --- a/Source/Core/CMakeLists.txt +++ b/Source/Core/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(Common) add_subdirectory(Core) add_subdirectory(DiscIO) add_subdirectory(DolphinWX) +add_subdirectory(DolphinNoGUI) add_subdirectory(InputCommon) add_subdirectory(UICommon) add_subdirectory(VideoCommon) diff --git a/Source/Core/DolphinNoGUI/CMakeLists.txt b/Source/Core/DolphinNoGUI/CMakeLists.txt new file mode 100644 index 0000000000..9a0b19a616 --- /dev/null +++ b/Source/Core/DolphinNoGUI/CMakeLists.txt @@ -0,0 +1,19 @@ +if(NOT(USE_X11 OR ENABLE_HEADLESS)) + return() +endif() + +set(NOGUI_SRCS MainNoGUI.cpp) + +add_executable(dolphin-nogui ${NOGUI_SRCS}) +set_target_properties(dolphin-nogui PROPERTIES OUTPUT_NAME dolphin-emu-nogui) + +target_link_libraries(dolphin-nogui PRIVATE + core + uicommon + cpp-optparse + ${LIBS} +) + +set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-nogui) +install(TARGETS dolphin-nogui RUNTIME DESTINATION ${bindir}) + diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp similarity index 99% rename from Source/Core/DolphinWX/MainNoGUI.cpp rename to Source/Core/DolphinNoGUI/MainNoGUI.cpp index 83dcae0e1a..d9293a0faa 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -168,7 +168,7 @@ void Host_YieldToUI() #if HAVE_X11 #include -#include "DolphinWX/X11Utils.h" +#include "UICommon/X11Utils.h" class PlatformX11 : public Platform { diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index bfdc71ef92..4689c2fd2b 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -79,13 +79,6 @@ set(GUI_SRCS WxUtils.cpp ) -set(NOGUI_SRCS MainNoGUI.cpp) - -if(USE_X11) - set(GUI_SRCS ${GUI_SRCS} X11Utils.cpp) - set(NOGUI_SRCS ${NOGUI_SRCS} X11Utils.cpp) -endif() - set(WXLIBS ${wxWidgets_LIBRARIES}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -200,11 +193,3 @@ if(wxWidgets_FOUND) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE}) endif() - -if(USE_X11 OR ENABLE_HEADLESS) - set(DOLPHIN_NOGUI_EXE ${DOLPHIN_EXE_BASE}-nogui) - add_executable(${DOLPHIN_NOGUI_EXE} ${SRCS} ${NOGUI_SRCS}) - target_link_libraries(${DOLPHIN_NOGUI_EXE} ${LIBS}) - set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_NOGUI_EXE}) - install(TARGETS ${DOLPHIN_NOGUI_EXE} RUNTIME DESTINATION ${bindir}) -endif() diff --git a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp index d2080743da..2b78a52a93 100644 --- a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp @@ -30,7 +30,7 @@ #include "DolphinWX/WxUtils.h" #if defined(HAVE_XRANDR) && HAVE_XRANDR -#include "DolphinWX/X11Utils.h" +#include "UICommon/X11Utils.h" #endif static const std::array language_ids{{ diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index 6e784e874d..a659412fe3 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -41,7 +41,7 @@ #include "InputCommon/GCAdapter.h" #if defined(HAVE_XRANDR) && HAVE_XRANDR -#include "DolphinWX/X11Utils.h" +#include "UICommon/X11Utils.h" #endif ControllerConfigDiag::ControllerConfigDiag(wxWindow* const parent) diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index bd8f92f04a..1555a1fe0a 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -21,7 +21,7 @@ #include "InputCommon/GCPadStatus.h" #if defined(HAVE_X11) && HAVE_X11 -#include "DolphinWX/X11Utils.h" +#include "UICommon/X11Utils.h" #endif // Class declarations diff --git a/Source/Core/UICommon/CMakeLists.txt b/Source/Core/UICommon/CMakeLists.txt index e25ad9abf9..36648bbe7c 100644 --- a/Source/Core/UICommon/CMakeLists.txt +++ b/Source/Core/UICommon/CMakeLists.txt @@ -5,6 +5,10 @@ set(SRCS USBUtils.cpp ) +if(USE_X11) + set(SRCS ${SRCS} X11Utils.cpp) +endif() + set(LIBS common cpp-optparse) if(LIBUSB_FOUND) set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) diff --git a/Source/Core/DolphinWX/X11Utils.cpp b/Source/Core/UICommon/X11Utils.cpp similarity index 99% rename from Source/Core/DolphinWX/X11Utils.cpp rename to Source/Core/UICommon/X11Utils.cpp index 76a78df48c..84273488a5 100644 --- a/Source/Core/DolphinWX/X11Utils.cpp +++ b/Source/Core/UICommon/X11Utils.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "DolphinWX/X11Utils.h" +#include "UICommon/X11Utils.h" #include #include diff --git a/Source/Core/DolphinWX/X11Utils.h b/Source/Core/UICommon/X11Utils.h similarity index 100% rename from Source/Core/DolphinWX/X11Utils.h rename to Source/Core/UICommon/X11Utils.h