From d3b0ce3acb468ff42dde1f01de152be8fb0f8365 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Tue, 11 Aug 2020 20:31:53 -0400 Subject: [PATCH 1/3] Updated build README for building GTK based GUI. --- README | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README b/README index 53c559fc..daa7e685 100644 --- a/README +++ b/README @@ -24,7 +24,7 @@ Table of Contents ---------------- * sdl2 - Version >= 2.0 * cmake - Required to build fceux. -* qt5 - version >= 5.11 recommended +* qt5 OR gtk3 - (qt version >= 5.11 recommended) (gtk3 >= 3.22 recommended) * liblua5.1 (optional) - Will statically link internally if the system cannot provide this. * minizip * zlib @@ -33,6 +33,7 @@ Table of Contents 2 - Installation ---------------- +The old scons build system is no longer supported. Fceux can be compiled and built using the cmake build system. To compile, run: mkdir build; cd build; @@ -41,6 +42,11 @@ Fceux can be compiled and built using the cmake build system. To compile, run: To build a binary with debug information included in it: cmake -DCMAKE_BUILD_TYPE=Debug .. +The Qt version of the GUI builds by default and this is the preferred GUI for use. +For those who must have GTK/Gnome style, +the GTK version of the GUI can be selected to build with: + cmake -DCMAKE_BUILD_TYPE=Release -DGTK=1 .. # Release build using GTK GUI + To do the actual compiling: make @@ -75,7 +81,9 @@ Look in the src/CMakeList.txt file to tweak options. 4 - GUI ------- -The Qt GUI is required and automatically builds as part of the build. +The Qt (or GTK) GUI is required and automatically builds as part of the build. The Qt GUI is the default. +When invoking cmake, the GTK GUI can be built (instead of Qt) by specifying a -DGTK=1 on the command line. +See above build instructions. 5 - LUA Scripting ----------------- @@ -107,7 +115,7 @@ The latest version of iup (3.5 at the time of writing) is recommended. ------- * Q. Im having issues with my sound! -* A. First of all, for the best sound quality be sure you are using SDL 1.2.14 or later. Versions 1.2.13 and earlier are known to have problems with fceux! Next, try different SDL audio drivers to see if this makes any difference. You can do this by using this command before running fceux: +* A. Try different SDL audio drivers to see if this makes any difference. You can do this by using this command before running fceux: export SDL_AUDIODRIVER=driver From d11cea3a9869c34710b3ae5b1b4d046f50643dfc Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Tue, 11 Aug 2020 20:58:54 -0400 Subject: [PATCH 2/3] Added OpenGL preference (GLVND or LEGACY) command line options to cmake build. --- README | 3 +++ src/CMakeLists.txt | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README b/README index daa7e685..e75719a6 100644 --- a/README +++ b/README @@ -84,6 +84,9 @@ Look in the src/CMakeList.txt file to tweak options. The Qt (or GTK) GUI is required and automatically builds as part of the build. The Qt GUI is the default. When invoking cmake, the GTK GUI can be built (instead of Qt) by specifying a -DGTK=1 on the command line. See above build instructions. +OpenGL options: +For Linux builds, the OpenGL library preference can be either GLVND or LEGACY (default). +To use GLVND OpenGL, add a -DGLVND=1 on the cmake command line. 5 - LUA Scripting ----------------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03331a32..f414cf5d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,9 @@ if ( ${GTK} ) +message( STATUS "GUI backend: GTK") set( APP_NAME fceux-gtk) else() +message( STATUS "GUI backend: QT") set( APP_NAME fceux) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -24,8 +26,13 @@ else(WIN32) # Non Windows System # UNIX (Linux or Mac OSX) - #set (OpenGL_GL_PREFERENCE GLVND) - set (OpenGL_GL_PREFERENCE LEGACY) + if ( ${GLVND} ) + message( STATUS "OpenGL preference: GLVND") + set (OpenGL_GL_PREFERENCE GLVND) + else() + message( STATUS "OpenGL preference: LEGACY") + set (OpenGL_GL_PREFERENCE LEGACY) + endif() # Use the built-in cmake find_package functions to find dependencies # Use package PkgConfig to detect headers/library what find_package cannot find. From 075190469309cecff5a2aaf37c3550260c074270 Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Tue, 11 Aug 2020 21:19:52 -0400 Subject: [PATCH 3/3] Added FCEUX debugger compiler flag to cmake build --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f414cf5d..e0252c99 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ else(WIN32) find_package(ZLIB REQUIRED) add_definitions( -Wall -Wno-write-strings -Wno-sign-compare -Wno-parentheses -Wno-unused-local-typedefs -fPIC ) + add_definitions( -DFCEUDEF_DEBUGGER ) if ( ${GTK} ) pkg_check_modules( GTK3 REQUIRED gtk+-3.0)