mirror of https://github.com/PCSX2/pcsx2.git
Loosen up wxwidget version restrictions. Default to Gtk 3. Cleanup. (#3832)
* Remove version and platform checks for wxwidgets. It's probably better to find *something* rather then fail because you have 3.1.2 and the build was looking for 3.0 when both work. * Build gtk 3 by default. Replace gtk 3 flag with one for gtk 2. * Remove two unused cmake modules. * Forgot to change a description in build.sh.
This commit is contained in:
parent
48bff06202
commit
540c69897e
4
build.sh
4
build.sh
|
@ -207,7 +207,7 @@ for ARG in "$@"; do
|
||||||
--sdl12 ) flags="$flags -DSDL2_API=FALSE" ;;
|
--sdl12 ) flags="$flags -DSDL2_API=FALSE" ;;
|
||||||
--extra ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
|
--extra ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
|
||||||
--asan ) flags="$flags -DUSE_ASAN=TRUE" ;;
|
--asan ) flags="$flags -DUSE_ASAN=TRUE" ;;
|
||||||
--gtk3 ) flags="$flags -DGTK3_API=TRUE" ;;
|
--gtk2 ) flags="$flags -DGTK2_API=TRUE" ;;
|
||||||
--lto ) flags="$flags -DUSE_LTO=TRUE" ;;
|
--lto ) flags="$flags -DUSE_LTO=TRUE" ;;
|
||||||
--pgo-optimize ) flags="$flags -DUSE_PGO_OPTIMIZE=TRUE" ;;
|
--pgo-optimize ) flags="$flags -DUSE_PGO_OPTIMIZE=TRUE" ;;
|
||||||
--pgo-generate ) flags="$flags -DUSE_PGO_GENERATE=TRUE" ;;
|
--pgo-generate ) flags="$flags -DUSE_PGO_GENERATE=TRUE" ;;
|
||||||
|
@ -244,7 +244,7 @@ for ARG in "$@"; do
|
||||||
echo "--no-portaudio : Skip portaudio for spu2x."
|
echo "--no-portaudio : Skip portaudio for spu2x."
|
||||||
echo
|
echo
|
||||||
echo "** Expert Developer option **"
|
echo "** Expert Developer option **"
|
||||||
echo "--gtk3 : replace GTK2 by GTK3"
|
echo "--gtk2 : use GTK 2 instead of GTK 3"
|
||||||
echo "--no-cross-multilib: Build a native PCSX2 (nonfunctional recompiler)"
|
echo "--no-cross-multilib: Build a native PCSX2 (nonfunctional recompiler)"
|
||||||
echo "--no-trans : Don't regenerate mo files when building."
|
echo "--no-trans : Don't regenerate mo files when building."
|
||||||
echo "--clang : Build with Clang/llvm"
|
echo "--clang : Build with Clang/llvm"
|
||||||
|
|
|
@ -47,7 +47,7 @@ option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
|
||||||
option(EXTRA_PLUGINS "Build various 'extra' plugins")
|
option(EXTRA_PLUGINS "Build various 'extra' plugins")
|
||||||
option(PORTAUDIO_API "Build portaudio support on spu2x" ON)
|
option(PORTAUDIO_API "Build portaudio support on spu2x" ON)
|
||||||
option(SDL2_API "Use SDL2 on spu2x and onepad (wxWidget mustn't be built with SDL1.2 support" ON)
|
option(SDL2_API "Use SDL2 on spu2x and onepad (wxWidget mustn't be built with SDL1.2 support" ON)
|
||||||
option(GTK3_API "Use GTK3 api (experimental/wxWidget must be built with GTK3 support)")
|
option(GTK2_API "Use GTK2 api (legacy)")
|
||||||
|
|
||||||
if(PACKAGE_MODE)
|
if(PACKAGE_MODE)
|
||||||
if(NOT DEFINED PLUGIN_DIR)
|
if(NOT DEFINED PLUGIN_DIR)
|
||||||
|
@ -435,16 +435,6 @@ endif()
|
||||||
# Use some default machine flags
|
# Use some default machine flags
|
||||||
string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
|
string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# Too much user/packager use experimental flags as release flags
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Release" OR PACKAGE_MODE)
|
|
||||||
if (GTK3_API)
|
|
||||||
message(WARNING "GTK3 is highly experimental besides it requires a wxWidget built with __WXGTK3__ support !!!")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# MacOS-specific things
|
# MacOS-specific things
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
# Find a NVidia Cg Toolkit installation
|
|
||||||
# This module finds a NVidia Cg Toolkit installation.
|
|
||||||
|
|
||||||
# CG_FOUND found Cg
|
|
||||||
# CG_INCLUDE_DIRS include path to cg.h
|
|
||||||
# CG_LIBRARIES path to Cg libs
|
|
||||||
# CG_COMPILER path to Cg compiler
|
|
||||||
|
|
||||||
# find Cg on Windows
|
|
||||||
if(WIN32)
|
|
||||||
# find Cg compiler
|
|
||||||
find_program(CG_COMPILER cgc PATHS
|
|
||||||
"C:/Program Files/NVIDIA Corporation/cg/bin"
|
|
||||||
DOC "Path to the Cg compiler.")
|
|
||||||
|
|
||||||
# find Cg include
|
|
||||||
find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS
|
|
||||||
"C:/Program Files/NVIDIA Corporation/cg/include"
|
|
||||||
DOC "Path to the Cg/GL includes.")
|
|
||||||
|
|
||||||
# find Cg libraries
|
|
||||||
# Cg library
|
|
||||||
find_library(CG_LIBRARY NAMES Cg PATHS
|
|
||||||
"C:/Program Files/NVIDIA Corporation/cg/lib"
|
|
||||||
DOC "Path to the Cg library.")
|
|
||||||
|
|
||||||
# Cg GL library
|
|
||||||
find_library(CG_GL_LIBRARY NAMES CgGL PATHS
|
|
||||||
"C:/Program Files/NVIDIA Corporation/cg/lib"
|
|
||||||
DOC "Path to the CgGL library.")
|
|
||||||
|
|
||||||
set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY})
|
|
||||||
|
|
||||||
else(WIN32) # Unix based OS
|
|
||||||
# find Cg compiler
|
|
||||||
find_program(CG_COMPILER cgc PATHS
|
|
||||||
/usr/bin
|
|
||||||
/usr/local/bin
|
|
||||||
/opt/nvidia-cg-toolkit/bin
|
|
||||||
DOC "Path to the Cg compiler.")
|
|
||||||
|
|
||||||
# find Cg include
|
|
||||||
find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include
|
|
||||||
/opt/nvidia-cg-toolkit/include
|
|
||||||
DOC "Path to the Cg/GL includes.")
|
|
||||||
|
|
||||||
# find Cg libraries
|
|
||||||
# Cg library
|
|
||||||
find_library(CG_LIBRARY NAMES Cg PATHS
|
|
||||||
/usr/include
|
|
||||||
/usr/local/lib
|
|
||||||
/opt/nvidia-cg-toolkit/lib
|
|
||||||
/opt/nvidia-cg-toolkit/lib32
|
|
||||||
DOC "Path to the Cg library.")
|
|
||||||
|
|
||||||
# Cg GL library
|
|
||||||
find_library(CG_GL_LIBRARY NAMES CgGL PATHS
|
|
||||||
/usr/include
|
|
||||||
/usr/local/lib
|
|
||||||
/opt/nvidia-cg-toolkit/lib
|
|
||||||
/opt/nvidia-cg-toolkit/lib32
|
|
||||||
DOC "Path to the CgGL library.")
|
|
||||||
|
|
||||||
set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY})
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set CG_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARIES CG_INCLUDE_DIRS)
|
|
||||||
|
|
||||||
mark_as_advanced(CG_FOUND CG_INCLUDE_DIRS CG_LIBRARIES CG_COMPILER)
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
#
|
|
||||||
# Try to find GLEW library and include path.
|
|
||||||
# Once done this will define
|
|
||||||
#
|
|
||||||
# GLEW_FOUND - system has GLEW
|
|
||||||
# GLEW_INCLUDE_DIR - the GLEW include directories
|
|
||||||
# GLEW_LIBRARY - link these to use GLEW
|
|
||||||
#
|
|
||||||
|
|
||||||
if(GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
|
|
||||||
set(GLEW_FIND_QUIETLY TRUE)
|
|
||||||
endif(GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
|
|
||||||
|
|
||||||
IF (WIN32)
|
|
||||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
|
||||||
$ENV{PROGRAMFILES}/GLEW/include
|
|
||||||
${CMAKE_SOURCE_DIR}/src/nvgl/glew/include
|
|
||||||
DOC "The directory where GL/glew.h resides")
|
|
||||||
FIND_LIBRARY( GLEW_LIBRARY
|
|
||||||
NAMES glew GLEW glew32 glew32s
|
|
||||||
PATHS
|
|
||||||
$ENV{PROGRAMFILES}/GLEW/lib
|
|
||||||
${CMAKE_SOURCE_DIR}/src/nvgl/glew/bin
|
|
||||||
${CMAKE_SOURCE_DIR}/src/nvgl/glew/lib
|
|
||||||
DOC "The GLEW library")
|
|
||||||
ELSE (WIN32)
|
|
||||||
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
DOC "The directory where GL/glew.h resides")
|
|
||||||
FIND_LIBRARY( GLEW_LIBRARY
|
|
||||||
NAMES GLEW glew
|
|
||||||
PATHS
|
|
||||||
/usr/lib32
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/lib32
|
|
||||||
/usr/local/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
DOC "The GLEW library")
|
|
||||||
ENDIF (WIN32)
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR)
|
|
||||||
|
|
||||||
mark_as_advanced(GLEW_LIBRARY GLEW_INCLUDE_DIR)
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ set(OpenGL_GL_PREFERENCE GLVND)
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
find_package(PNG)
|
find_package(PNG)
|
||||||
find_package(Vtune)
|
find_package(Vtune)
|
||||||
|
|
||||||
# The requirement of wxWidgets is checked in SelectPcsx2Plugins module
|
# The requirement of wxWidgets is checked in SelectPcsx2Plugins module
|
||||||
# Does not require the module (allow to compile non-wx plugins)
|
# Does not require the module (allow to compile non-wx plugins)
|
||||||
# Force the unicode build (the variable is only supported on cmake 2.8.3 and above)
|
# Force the unicode build (the variable is only supported on cmake 2.8.3 and above)
|
||||||
|
@ -35,13 +36,15 @@ else()
|
||||||
set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
|
set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
|
# I'm removing the version check, because it excludes newer versions and requires specifically 3.0.
|
||||||
|
#list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
|
||||||
|
|
||||||
if(GTK3_API AND NOT APPLE)
|
# Let's not specifically require Gtk 2 or 3, either. As long as you have wx there...
|
||||||
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
|
#if(GTK2_API AND NOT APPLE)
|
||||||
elseif(NOT APPLE)
|
# list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
|
||||||
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
|
#elseif(NOT APPLE)
|
||||||
endif()
|
# list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
|
||||||
|
#endif()
|
||||||
|
|
||||||
# wx2.8 => /usr/bin/wx-config-2.8
|
# wx2.8 => /usr/bin/wx-config-2.8
|
||||||
# lib32-wx2.8 => /usr/bin/wx-config32-2.8
|
# lib32-wx2.8 => /usr/bin/wx-config32-2.8
|
||||||
|
@ -66,9 +69,21 @@ else()
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
|
||||||
endif()
|
endif()
|
||||||
|
if(EXISTS "/usr/bin/wx-config-3.2")
|
||||||
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.2")
|
||||||
|
endif()
|
||||||
|
if(EXISTS "/usr/bin/wx-config-3.1")
|
||||||
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.1")
|
||||||
|
endif()
|
||||||
if(EXISTS "/usr/bin/wx-config-3.0")
|
if(EXISTS "/usr/bin/wx-config-3.0")
|
||||||
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
|
||||||
endif()
|
endif()
|
||||||
|
if(EXISTS "/usr/bin/wx-config")
|
||||||
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config")
|
||||||
|
endif()
|
||||||
|
if(EXISTS "/usr/bin/wx-config-gtk3")
|
||||||
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-gtk3")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(wxWidgets COMPONENTS base core adv)
|
find_package(wxWidgets COMPONENTS base core adv)
|
||||||
|
@ -77,13 +92,6 @@ find_package(ZLIB)
|
||||||
## Use pcsx2 package to find module
|
## Use pcsx2 package to find module
|
||||||
include(FindLibc)
|
include(FindLibc)
|
||||||
|
|
||||||
## Only needed by the extra plugins
|
|
||||||
if(EXTRA_PLUGINS)
|
|
||||||
include(FindCg)
|
|
||||||
include(FindGlew)
|
|
||||||
find_package(JPEG)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
## Use CheckLib package to find module
|
## Use CheckLib package to find module
|
||||||
include(CheckLib)
|
include(CheckLib)
|
||||||
if(Linux)
|
if(Linux)
|
||||||
|
@ -116,14 +124,14 @@ endif()
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
# Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
|
# Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
|
||||||
if (GTK3_API)
|
if (GTK2_API)
|
||||||
if(CMAKE_CROSSCOMPILING)
|
find_package(GTK2 REQUIRED gtk)
|
||||||
find_package(GTK3 REQUIRED gtk)
|
|
||||||
else()
|
|
||||||
check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
find_package(GTK2 REQUIRED gtk)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
find_package(GTK3 REQUIRED gtk)
|
||||||
|
else()
|
||||||
|
check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -131,12 +139,12 @@ endif()
|
||||||
# Use system include
|
# Use system include
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
if(GTK2_FOUND)
|
if(GTK3_FOUND)
|
||||||
include_directories(${GTK2_INCLUDE_DIRS})
|
include_directories(${GTK3_INCLUDE_DIRS})
|
||||||
elseif(GTK3_FOUND)
|
|
||||||
include_directories(${GTK3_INCLUDE_DIRS})
|
|
||||||
# A lazy solution
|
# A lazy solution
|
||||||
set(GTK2_LIBRARIES ${GTK3_LIBRARIES})
|
set(GTK2_LIBRARIES ${GTK3_LIBRARIES})
|
||||||
|
elseif(GTK2_FOUND)
|
||||||
|
include_directories(${GTK2_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(X11_FOUND)
|
if(X11_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue