Browse Source

Fixed build using clang-cl on Windows

Sam Lantinga 2 years ago
parent
commit
5970311353
1 changed files with 6 additions and 1 deletions
  1. 6 1
      CMakeLists.txt

+ 6 - 1
CMakeLists.txt

@@ -587,7 +587,12 @@ if(USE_GCC OR USE_CLANG)
         target_compile_options(sdl-global-options INTERFACE "-Werror=documentation")
         target_compile_options(sdl-global-options INTERFACE "-Werror=documentation")
       endif()
       endif()
     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()
   endif()
 
 
   if(DEPENDENCY_TRACKING)
   if(DEPENDENCY_TRACKING)