From 6e28a8e694ec2af2b953eb47a131e2a624978fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Sat, 3 Jan 2015 19:56:50 -0500 Subject: [PATCH] Update the archlinux wx fix. This fixes it for build.sh and when not using build.sh (packaging). . Also fix native 32bit build which should also be broken and attempt to predict the future and fix it for lib32-wx3.0. Worst case the filenames have to be fixed which is trivial. . When wx2.8 support is dropped then only the lib32-wx3.0 IF should remain. When crosscompilation support gets dropped then the first IF gets deleted unless we also dropped wx2.8 support then everything gets deleted. --- build.sh | 5 ----- cmake/SearchForStuff.cmake | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 5f85aa35a7..cd2b1bf0bd 100755 --- a/build.sh +++ b/build.sh @@ -20,7 +20,6 @@ flags=(-DCMAKE_BUILD_PO=FALSE) cleanBuild=0 useClang=0 -Build64=0 for ARG in "$@"; do case "$ARG" in @@ -70,10 +69,6 @@ for ARG in "$@"; do esac done -if [[ (-f /usr/bin/wx-config32-2.8 && -f /usr/bin/wxrc32-2.8) && "$Build64" -eq 0 ]]; then -#add flags for archlinux, wx 3 is not yet in main repositories, wx2.8 need to be used for now -flags+=(-DwxWidgets_CONFIG_EXECUTABLE='/usr/bin/wx-config32-2.8' -DwxWidgets_wxrc_EXECUTABLE='/usr/bin/wxrc32-2.8' -DWX28_API=TRUE) -fi root=$PWD/$(dirname "$0") log=$root/install_log.txt build=$root/build diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 5e3d0278ab..f8897472cf 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -22,6 +22,35 @@ if(Fedora AND CMAKE_CROSSCOMPILING) else() set(wxWidgets_CONFIG_OPTIONS --unicode=yes) endif() + +# Temprorary help for Arch-based distros. +# They have wx2.8, lib32-wx2.8 and wx3.0 but no lib32-wx3.0. +# wx2.8 => /usr/bin/wx-config-2.8, /usr/bin/wxrc-2.8 +# lib32-wx2.8 => /usr/bin/wx-config32-2.8, /usr/bin/wxrc32-2.8 +# wx3.0 => /usr/bin/wx-config, /usr/bin/wxrc -> /usr/bin/wxrc-3.0 +# I'm going to take a wild guess and predict this: +# lib32-wx3.0 => /usr/bin/wx-config32-3.0, /usr/bin/wxrc32-3.0 +# FindwxWidgets only searches for wxrc and wx-config. Therefore only native +# wx3.0 works since everything else has non-standard naming. +if(CMAKE_CROSSCOMPILING) + # Prefer wx3.0 if available. May need to fix the filenames for lib32-wx3.0. + if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-3.0" AND EXISTS "/usr/bin/wxrc32-3.0") + set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-3.0") + set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc32-3.0") + elseif(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-2.8" AND EXISTS "/usr/bin/wxrc32-2.8") + set(WX28_API TRUE) + set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-2.8") + set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc32-2.8") + endif() +else() + # Prefer wx3.0 if available. + if(EXISTS "/usr/bin/wx-config-2.8" AND EXISTS "/usr/bin/wxrc-2.8" AND (NOT EXISTS "/usr/bin/wx-config" OR NOT EXISTS "/usr/bin/wxrc")) + set(WX28_API TRUE) + set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-2.8") + set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc-2.8") + endif() +endif() + find_package(wxWidgets COMPONENTS base core adv) find_package(ZLIB)