Browse Source

Fix Android build error due to declaration after statement (using GCC).
Close #1690 [ci only: Android]

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
98d1eba903
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/ThirdParty/SDL/CMakeLists.txt

+ 2 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -382,7 +382,8 @@ if(USE_GCC OR USE_CLANG)
   check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
   if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
     check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
-    if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
+    # Urho3D - bug fix - SDL does not build cleanly for Android platform with this flag on, make a tweak here rather than changing on their code
+    if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT AND NOT ANDROID)
       list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement")
     endif()
     list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")