From d09fee90ad83f26f100393712092caa4e3222c42 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 29 Jun 2014 08:51:21 +0200 Subject: [PATCH] wx3.0: add cmake support (2.8 by default) use ./build.sh --wx30 for wx3.0 --- build.sh | 4 ++++ cmake/BuildParameters.cmake | 1 + cmake/SearchForStuff.cmake | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7f20f29ddc..f5441036de 100755 --- a/build.sh +++ b/build.sh @@ -33,6 +33,8 @@ do --asan ) flags="$flags -DUSE_ASAN=TRUE";; --clang ) use_clang=1; flags="$flags -DUSE_CLANG=TRUE" ;; --clean ) clean_build=1 ;; + --wx28 ) flags="$flags -DWX28_API=TRUE" ;; + --wx30 ) flags="$flags -DWX28_API=FALSE" ;; *) # unknown option @@ -46,6 +48,8 @@ do echo "--extra : Build all plugins" echo "--asan : Enable with Address sanitizer" echo "" + echo "--wx28 : Force wxWidget 2.8" + echo "--wx30 : Allow to use wxWidget 3.0" echo "--glsl : Replace CG backend of ZZogl by GLSL" echo "--egl : Replace GLX by EGL (ZZogl plugins only)" echo "--sdl2 : Build with SDL2 (crash if wx is linked to SDL1)" diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 5848051ea1..d441567af9 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -35,6 +35,7 @@ option(EXTRA_PLUGINS "Build various 'extra' plugins") # FIXME do a proper detection set(SDL2_LIBRARY "-lSDL2") option(SDL2_API "Use SDL2 on spu2x and onepad") +option(WX28_API "Force wxWidget 2.8 lib. Default:ON" ON) if(PACKAGE_MODE) if(NOT DEFINED PLUGIN_DIR) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index ae6c055511..73d0699f33 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -167,7 +167,7 @@ if(wxWidgets_FOUND) ### 2.8 # -I/usr/lib/i386-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread # -L/usr/lib/i386-linux-gnu -pthread -Wl,-z,relro -L/usr/lib/i386-linux-gnu -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 - if ("${wxWidgets_INCLUDE_DIRS}" MATCHES "3.0") + if ("${wxWidgets_INCLUDE_DIRS}" MATCHES "3.0" AND WX28_API) message(WARNING "\nWxwidget 3.0 is installed on your system whereas PCSX2 required 2.8 !!!\nPCSX2 will try to use 2.8 but if it would be better to fix your setup.\n") STRING(REGEX REPLACE "unicode" "unicode-release" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") STRING(REGEX REPLACE "3\\.0" "2.8" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")