From 5da85905ae4b67dbf742d9f9f5cbf16a77d2193d Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Wed, 14 Aug 2024 18:58:16 +0800
Subject: [PATCH] macos-setup: do not use clang flag with gcc

---
 cmake/macos-setup.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git cmake/macos-setup.cmake cmake/macos-setup.cmake
index 58681f572..c01ae829a 100644
--- cmake/macos-setup.cmake
+++ cmake/macos-setup.cmake
@@ -5,7 +5,9 @@ execute_process(
   OUTPUT_STRIP_TRAILING_WHITESPACE
   )
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef-prefix=TARGET_OS_ ")
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef-prefix=TARGET_OS_ ")
+endif()
 
 if (HOMEBREW EQUAL 0 AND EXISTS "${HOMEBREW_PREFIX}")
   message(STATUS "Found Homebrew at ${HOMEBREW_PREFIX}")
-- 
2.46.0

