Commit 8770f082 authored by James Zern's avatar James Zern

configure/cmake: force -std=c99

BUG=aomedia:111

Change-Id: I4ed7b6998023975cd2834266be9caf44e2631f2c
parent 7a266e29
......@@ -31,6 +31,14 @@ if (MSVC)
add_compiler_flag_if_supported("/WX")
endif ()
else ()
set(c99_flag "-std=c99")
check_c_compiler_flag(${c99_flag} C99_FLAG_SUPPORTED)
if (C99_FLAG_SUPPORTED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${c99_flag}" CACHE STRING "" FORCE)
else ()
# report error
message(FATAL_ERROR "C99 support by the compiler is required!")
endif ()
add_compiler_flag_if_supported("-Wall")
add_compiler_flag_if_supported("-Wdeclaration-after-statement")
add_compiler_flag_if_supported("-Wdisabled-optimization")
......
......@@ -672,6 +672,8 @@ check_xcode_minimum_version() {
}
process_common_toolchain() {
add_cflags_only -std=c99
if [ -z "$toolchain" ]; then
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment