Added X11 Force Mode as a option that can be turned on and off. See #128 for details.

This commit is contained in:
Michael J. Manley
2023-07-22 01:45:59 -07:00
parent 4dcec4c2d6
commit b19fbf64fd
5 changed files with 13 additions and 33 deletions

View File

@@ -1,32 +0,0 @@
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"project": "CMakeLists.txt",
"projectTarget": "pcem.exe (src\\pcem.exe)",
"name": "PCem 64-bit Debugger",
"type": "cppdbg",
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
"inheritEnvironments": [
"mingw_64"
],
"MIMode": "gdb",
"program": "${debugInfo.target}",
"externalConsole": true
},
{
"project": "CMakeLists.txt",
"projectTarget": "pcem.exe (src\\pcem.exe)",
"name": "PCem 32-bit Debugger",
"type": "cppdbg",
"miDebuggerPath": "C:\\msys64\\mingw32\\bin\\gdb.exe",
"inheritEnvironments": [
"mingw_i686"
],
"MIMode": "gdb",
"program": "${debugInfo.target}",
"externalConsole": true
}
]
}

View File

@@ -46,6 +46,8 @@ endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
option(USE_ALSA "Build PCem with MIDI output using ALSA" OFF)
message("ALSA MIDI Support: ${USE_ALSA}")
option(FORCE_X11 "Force X11 Mode on Wayland Systems" ON)
message("Force X11 Mode on Wayland Systems: ${FORCE_X11}")
endif()
option(USE_EXPERIMENTAL "Build PCem with experimental code" OFF)

View File

@@ -42,9 +42,10 @@ configure options are :
```
-DCMAKE_BUILD_TYPE=Release : Generate release build. Recommended for regular use.
-DCMAKE_BUILD_TYPE=Debug : Compile with debugging enabled.
-DUSE_NETWORKING=OFF : Build with networking support.
-DUSE_NETWORKING=ON : Build with networking support.
-DUSE_PCAP_NETWORKING=ON : Build with pcap networking support. (Needs USE_NETWORKING to compile) Requires libpcap.
-DUSE_ALSA=OFF : Build with support for MIDI output through ALSA. Requires libasound. (Linux Only)
-DFORCE_X11=ON : Enables a hack to force X11 on Wayland systems. See #128 for details. (Linux Only)
-DPLUGIN_ENGINE=OFF : Build with plugin support. Builds libpcem-plugin-api and links PCem with it.
```

View File

@@ -1,3 +1,7 @@
if(FORCE_X11)
set(PCEM_DEFINES ${PCEM_DEFINES} FORCE_X11)
endif()
set(PCEM_PRIVATE_API ${PCEM_PRIVATE_API}
${CMAKE_SOURCE_DIR}/includes/private/bswap.h
${CMAKE_SOURCE_DIR}/includes/private/fdi2raw.h

View File

@@ -22,6 +22,11 @@ int main(int argc, char **argv)
char **argv = __argv;
#endif
#ifdef FORCE_X11
setenv("SDL_VIDEODRIVER", "x11", 1);
setenv("GDK_BACKEND", "x11", 1);
#endif
if (!pc_main(argc, argv))
return -1;