From 597031135337056dc804d805e1a93eaab7bb8d87 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 25 Jan 2023 14:45:51 -0800
Subject: [PATCH] Fixed build using clang-cl on Windows
---
CMakeLists.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0850b8069d6e..af84fa4865dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -587,7 +587,12 @@ if(USE_GCC OR USE_CLANG)
target_compile_options(sdl-global-options INTERFACE "-Werror=documentation")
endif()
endif()
- target_compile_options(sdl-global-options INTERFACE "-Wdocumentation;-fcomment-block-commands=threadsafety")
+ target_compile_options(sdl-global-options INTERFACE "-Wdocumentation")
+
+ check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS)
+ if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
+ target_compile_options(sdl-global-options INTERFACE "-fcomment-block-commands=threadsafety")
+ endif()
endif()
if(DEPENDENCY_TRACKING)