From 0f7dca99d187525d36a0afc7439a3359df18ba6c Mon Sep 17 00:00:00 2001
From: idk <hankhill19580@gmail.com>
Date: Mon, 2 Jan 2023 16:59:23 +0000
Subject: [PATCH] don't attempt to pass windows flags to cc when building
 jbigi, jcpuid on non-Windows platforms

---
 core/c/jcpuid/build.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/core/c/jcpuid/build.sh b/core/c/jcpuid/build.sh
index 26464b0eec..daf945ff71 100755
--- a/core/c/jcpuid/build.sh
+++ b/core/c/jcpuid/build.sh
@@ -157,6 +157,13 @@ echo "INCLUDES:$INCLUDES"
 
 echo "Compiling C code..."
 rm -f ${LIBFILE}
-"${CC_PREFIX}""${CC}" ${CFLAGS} ${LDFLAGS} ${INCLUDES} "${WINDOWS_INCLUDES}" "${WINDOWS_INCLUDES_HOST}" src/*.c -o "${LIBFILE}" || (echo "Failed to compile ${LIBFILE}"; exit 1)
+case "$TARGET" in
+    MINGW*|CYGWIN*|windows*)
+        "${CC_PREFIX}""${CC}" ${CFLAGS} ${LDFLAGS} ${INCLUDES} "${WINDOWS_INCLUDES}" "${WINDOWS_INCLUDES_HOST}" src/*.c -o "${LIBFILE}" || (echo "Failed to compile ${LIBFILE}"; exit 1)
+        ;;
+    *)
+        "${CC_PREFIX}""${CC}" ${CFLAGS} ${LDFLAGS} ${INCLUDES} src/*.c -o "${LIBFILE}" || (echo "Failed to compile ${LIBFILE}"; exit 1)
+        ;;
+esac
 "${CC_PREFIX}"strip "${LIBFILE}" || (echo "Failed to strip ${LIBFILE}" ; exit 1)
 echo Built "$(dirname "$0")"/"${LIBFILE}"
-- 
GitLab