mirror of https://github.com/encounter/SDL.git
cmake: add -Wno-declaration-after-statement to cpu-features.c alone
This commit is contained in:
parent
7becbd7d42
commit
a193a03d81
|
@ -602,9 +602,6 @@ if(USE_GCC OR USE_CLANG)
|
||||||
list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
|
list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Android needs to bring in external files that don't adhere to the declaration-after-statement
|
|
||||||
# warning, so skip this warning on Android.
|
|
||||||
if(NOT ANDROID)
|
|
||||||
check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
|
check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
|
||||||
if(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)
|
check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
|
||||||
|
@ -613,7 +610,6 @@ if(USE_GCC OR USE_CLANG)
|
||||||
endif()
|
endif()
|
||||||
list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")
|
list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(DEPENDENCY_TRACKING)
|
if(DEPENDENCY_TRACKING)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
|
@ -1129,6 +1125,7 @@ endif()
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
|
file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
|
||||||
list(APPEND SOURCE_FILES ${ANDROID_CORE_SOURCES} ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
|
list(APPEND SOURCE_FILES ${ANDROID_CORE_SOURCES} ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
|
||||||
|
set_property(SOURCE "${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-declaration-after-statement")
|
||||||
|
|
||||||
if(SDL_MISC)
|
if(SDL_MISC)
|
||||||
file(GLOB ANDROID_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/android/*.c)
|
file(GLOB ANDROID_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/android/*.c)
|
||||||
|
|
Loading…
Reference in New Issue