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)