From 87e41300f1a51c58c8ac40bc00a8176ddbb205e6 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 4 Feb 2022 04:45:07 +0000 Subject: [PATCH] Speedup wx-config search on MSYS2. Search for wx-config-static for static builds first, and wx-config otherwise, before trying any config and version suffixes. Signed-off-by: Rafael Kitover --- cmake/VbamFunctions.cmake | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cmake/VbamFunctions.cmake b/cmake/VbamFunctions.cmake index ce866cc8..89a0b70a 100644 --- a/cmake/VbamFunctions.cmake +++ b/cmake/VbamFunctions.cmake @@ -78,22 +78,23 @@ function(check_clean_exit var) endfunction() function(find_wx_util var util) - if(EXISTS /etc/gentoo-release) - # On win32, including cross builds we prefer the plain utility name - # first from PATH. + if(WIN32 OR EXISTS /etc/gentoo-release) + # On win32, including cross builds we prefer the plain utility + # name first from PATH, with the exception of -static for static + # builds. # - # On Gentoo /usr/bin/wx-config loads the eselected build, so we want - # to try that first. + # On Gentoo /usr/bin/wx-config loads the eselected build, so we + # want to try that first. # # This makes a one element of empty string list. - set(conf_suffixes ";") - set(major_versions ";") - elseif(WIN32) - set(major_versions ";") - endif() - if(VBAM_STATIC) - list(APPEND conf_suffixes static) + if(VBAM_STATIC) + set(conf_suffixes "static;") + else() + set(conf_suffixes ";") + endif() + + set(major_versions ";") endif() list(APPEND conf_suffixes gtk4u gtk4 gtk3u gtk3 gtk2u gtk2 "")