From 0945fc5446bd554ddf65028edebd6f5cd3d014ee Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 19 Aug 2023 08:57:43 +0100 Subject: [PATCH] Fix breakage in winegcc build script. Apparently when I started using _wfopen in commit 8bd75b85eda6e4d, the winegcc build (which I mostly use for Coverity Scan) stopped working, because _wfopen isn't included in any of the libraries I explicitly had on my link line. Rather than mess about with cmake, it's easier to just bodge it in the winegcc wrapper script, since we had one of those already. --- cmake/winegcc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/winegcc b/cmake/winegcc index fb298ad1..afa17de6 100755 --- a/cmake/winegcc +++ b/cmake/winegcc @@ -5,6 +5,7 @@ # options that CMake gets wrong. init=true +link=true for arg in init "$@"; do if $init; then set -- @@ -21,9 +22,18 @@ for arg in init "$@"; do # suffix. -l*.lib) set -- "$@" "${arg%.lib}";; + # Options that mean we're not linking. + -E | -S | -c) link=false set -- "$@" "$arg";; + # Anything else, we leave unchanged. *) set -- "$@" "$arg";; esac done +if $link; then + # winegcc requires this library for _wfopen + set -- "$@" -lucrtbase +fi + +echo "$@" >&2 exec winegcc "$@"