mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #755 from magcius/clean-up-nogui
Allow building MainNoGUI and MainGUI simultaneously
This commit is contained in:
@ -23,62 +23,56 @@ if(LIBAV_FOUND)
|
||||
set(LIBS ${LIBS} ${LIBAV_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(wxWidgets_FOUND)
|
||||
set(SRCS
|
||||
ARCodeAddEdit.cpp
|
||||
AboutDolphin.cpp
|
||||
CheatsWindow.cpp
|
||||
ConfigMain.cpp
|
||||
Debugger/BreakpointDlg.cpp
|
||||
Debugger/BreakpointView.cpp
|
||||
Debugger/BreakpointWindow.cpp
|
||||
Debugger/CodeView.cpp
|
||||
Debugger/CodeWindow.cpp
|
||||
Debugger/CodeWindowFunctions.cpp
|
||||
Debugger/DSPDebugWindow.cpp
|
||||
Debugger/DSPRegisterView.cpp
|
||||
Debugger/DebuggerPanel.cpp
|
||||
Debugger/DebuggerUIUtil.cpp
|
||||
Debugger/JitWindow.cpp
|
||||
Debugger/MemoryCheckDlg.cpp
|
||||
Debugger/MemoryView.cpp
|
||||
Debugger/MemoryWindow.cpp
|
||||
Debugger/RegisterView.cpp
|
||||
Debugger/RegisterWindow.cpp
|
||||
FifoPlayerDlg.cpp
|
||||
Frame.cpp
|
||||
FrameAui.cpp
|
||||
FrameTools.cpp
|
||||
GameListCtrl.cpp
|
||||
GeckoCodeDiag.cpp
|
||||
HotkeyDlg.cpp
|
||||
ISOFile.cpp
|
||||
ISOProperties.cpp
|
||||
InputConfigDiag.cpp
|
||||
InputConfigDiagBitmaps.cpp
|
||||
LogConfigWindow.cpp
|
||||
LogWindow.cpp
|
||||
Main.cpp
|
||||
MemcardManager.cpp
|
||||
MemoryCards/WiiSaveCrypted.cpp
|
||||
NetWindow.cpp
|
||||
PatchAddEdit.cpp
|
||||
SoftwareVideoConfigDialog.cpp
|
||||
TASInputDlg.cpp
|
||||
VideoConfigDiag.cpp
|
||||
WXInputBase.cpp
|
||||
WiimoteConfigDiag.cpp
|
||||
WxUtils.cpp)
|
||||
set(GUI_SRCS
|
||||
ARCodeAddEdit.cpp
|
||||
AboutDolphin.cpp
|
||||
CheatsWindow.cpp
|
||||
ConfigMain.cpp
|
||||
Debugger/BreakpointDlg.cpp
|
||||
Debugger/BreakpointView.cpp
|
||||
Debugger/BreakpointWindow.cpp
|
||||
Debugger/CodeView.cpp
|
||||
Debugger/CodeWindow.cpp
|
||||
Debugger/CodeWindowFunctions.cpp
|
||||
Debugger/DSPDebugWindow.cpp
|
||||
Debugger/DSPRegisterView.cpp
|
||||
Debugger/DebuggerPanel.cpp
|
||||
Debugger/DebuggerUIUtil.cpp
|
||||
Debugger/JitWindow.cpp
|
||||
Debugger/MemoryCheckDlg.cpp
|
||||
Debugger/MemoryView.cpp
|
||||
Debugger/MemoryWindow.cpp
|
||||
Debugger/RegisterView.cpp
|
||||
Debugger/RegisterWindow.cpp
|
||||
FifoPlayerDlg.cpp
|
||||
Frame.cpp
|
||||
FrameAui.cpp
|
||||
FrameTools.cpp
|
||||
GameListCtrl.cpp
|
||||
GeckoCodeDiag.cpp
|
||||
HotkeyDlg.cpp
|
||||
ISOFile.cpp
|
||||
ISOProperties.cpp
|
||||
InputConfigDiag.cpp
|
||||
InputConfigDiagBitmaps.cpp
|
||||
LogConfigWindow.cpp
|
||||
LogWindow.cpp
|
||||
Main.cpp
|
||||
MemcardManager.cpp
|
||||
MemoryCards/WiiSaveCrypted.cpp
|
||||
NetWindow.cpp
|
||||
PatchAddEdit.cpp
|
||||
SoftwareVideoConfigDialog.cpp
|
||||
TASInputDlg.cpp
|
||||
VideoConfigDiag.cpp
|
||||
WXInputBase.cpp
|
||||
WiimoteConfigDiag.cpp
|
||||
WxUtils.cpp)
|
||||
|
||||
set(WXLIBS ${wxWidgets_LIBRARIES} dl)
|
||||
else()
|
||||
if(ANDROID)
|
||||
set(SRCS Android/ButtonManager.cpp
|
||||
MainAndroid.cpp)
|
||||
else()
|
||||
set(SRCS MainNoGUI.cpp)
|
||||
endif()
|
||||
endif()
|
||||
set(WXLIBS ${wxWidgets_LIBRARIES} dl)
|
||||
|
||||
set(ANDROID_SRCS Android/ButtonManager.cpp
|
||||
MainAndroid.cpp)
|
||||
|
||||
if(USE_EGL)
|
||||
set(SRCS ${SRCS} GLInterface/Platform.cpp
|
||||
@ -102,6 +96,8 @@ else()
|
||||
endif()
|
||||
set(SRCS ${SRCS} GLInterface/GLInterface.cpp)
|
||||
|
||||
set(NOGUI_SRCS MainNoGUI.cpp)
|
||||
|
||||
if(WIN32)
|
||||
set(SRCS ${SRCS} stdafx.cpp)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
@ -140,11 +136,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
else()
|
||||
set(DOLPHIN_EXE_BASE dolphin-emu)
|
||||
endif()
|
||||
if(wxWidgets_FOUND)
|
||||
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
|
||||
else()
|
||||
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE}-nogui)
|
||||
endif()
|
||||
|
||||
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
|
||||
|
||||
if(USE_UPNP)
|
||||
set(LIBS ${LIBS} miniupnpc)
|
||||
@ -159,7 +152,7 @@ endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(DOLPHIN_EXE main)
|
||||
add_library(${DOLPHIN_EXE} SHARED ${SRCS})
|
||||
add_library(${DOLPHIN_EXE} SHARED ${SRCS} ${ANDROID_SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE}
|
||||
log
|
||||
android
|
||||
@ -180,8 +173,10 @@ if(ANDROID)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS -r ${CMAKE_SOURCE_DIR}/Data/Sys/Shaders ${CMAKE_SOURCE_DIR}/Source/Android/assets/
|
||||
)
|
||||
else()
|
||||
add_executable(${DOLPHIN_EXE} ${SRCS})
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||
elseif(wxWidgets_FOUND)
|
||||
add_executable(${DOLPHIN_EXE} ${SRCS} ${GUI_SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
include(BundleUtilities)
|
||||
@ -268,6 +263,13 @@ else()
|
||||
else()
|
||||
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} ${DOLPHIN_EXE})
|
||||
if(USE_X11)
|
||||
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})
|
||||
endif()
|
||||
|
@ -175,7 +175,10 @@ static wxArrayString GetListOfResolutions()
|
||||
ZeroMemory(&dmi, sizeof(dmi));
|
||||
}
|
||||
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
main_frame->m_XRRConfig->AddResolutions(retlist);
|
||||
std::vector<std::string> resos;
|
||||
main_frame->m_XRRConfig->AddResolutions(resos);
|
||||
for (auto res : resos)
|
||||
retlist.Add(StrToWxStr(res));
|
||||
#elif defined(__APPLE__)
|
||||
CFArrayRef modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), nullptr);
|
||||
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
|
||||
|
@ -254,8 +254,7 @@ void XRRConfiguration::ToggleDisplayMode(bool bFullscreen)
|
||||
XSync(dpy, false);
|
||||
}
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenResolution)
|
||||
void XRRConfiguration::AddResolutions(std::vector<std::string>& resos)
|
||||
{
|
||||
if (!bValid || !screenResources)
|
||||
return;
|
||||
@ -268,7 +267,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe
|
||||
|
||||
if (output_info && output_info->crtc && output_info->connection == RR_Connected)
|
||||
{
|
||||
std::vector<std::string> resos;
|
||||
for (int j = 0; j < output_info->nmode; j++)
|
||||
for (int k = 0; k < screenResources->nmode; k++)
|
||||
if (output_info->modes[j] == screenResources->modes[k].id)
|
||||
@ -280,7 +278,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe
|
||||
if (std::find(resos.begin(), resos.end(), strRes) == resos.end())
|
||||
{
|
||||
resos.push_back(strRes);
|
||||
arrayStringFor_FullscreenResolution.Add(StrToWxStr(strRes));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -288,7 +285,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe
|
||||
XRRFreeOutputInfo(output_info);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -51,9 +51,7 @@ class XRRConfiguration
|
||||
|
||||
void Update();
|
||||
void ToggleDisplayMode(bool bFullscreen);
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
void AddResolutions(wxArrayString& arrayStringFor_FullscreenResolution);
|
||||
#endif
|
||||
void AddResolutions(std::vector<std::string>& resos);
|
||||
|
||||
private:
|
||||
Display *dpy;
|
||||
|
Reference in New Issue
Block a user