瀏覽代碼

Merge commit '1e8443f54e4ec729ce4a003e1636219702fb1de5' into main

Sam Lantinga 2 年之前
父節點
當前提交
986ecec436
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      CMakeLists.txt

+ 8 - 2
CMakeLists.txt

@@ -560,14 +560,20 @@ if(USE_GCC OR USE_CLANG)
         if(CMAKE_VERSION VERSION_LESS 3.3)
           target_compile_options(sdl-global-options INTERFACE "-Werror=declaration-after-statement")
         else()
-          target_compile_options(sdl-global-options INTERFACE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:OBJCC>>:-Werror=declaration-after-statement>")
+          target_compile_options(sdl-global-options INTERFACE "$<$<COMPILE_LANGUAGE:C>:-Werror=declaration-after-statement>")
+          if(CMAKE_OBJC_COMPILER)
+              target_compile_options(sdl-global-options INTERFACE "$<$<COMPILE_LANGUAGE:OBJC>:-Werror=declaration-after-statement>")
+          endif()
         endif()
       endif()
     endif()
     if(CMAKE_VERSION VERSION_LESS 3.3)
       target_compile_options(sdl-global-options INTERFACE "-Wdeclaration-after-statement")
     else()
-      target_compile_options(sdl-global-options INTERFACE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:OBJC>>:-Wdeclaration-after-statement>")
+      target_compile_options(sdl-global-options INTERFACE "$<$<COMPILE_LANGUAGE:C>:-Wdeclaration-after-statement>")
+      if(CMAKE_OBJC_COMPILER)
+          target_compile_options(sdl-global-options INTERFACE "$<$<COMPILE_LANGUAGE:OBJC>:-Wdeclaration-after-statement>")
+      endif()
     endif()
   endif()