diff options
| author | Ahmad Fatoum <[email protected]> | 2018-01-25 22:34:29 +0100 |
|---|---|---|
| committer | Ahmad Fatoum <[email protected]> | 2018-01-25 22:34:29 +0100 |
| commit | 8be93762d9a94a56bf430e0e177bdefb5b1fa0dd (patch) | |
| tree | e04cef8d633f2bbf453ac4069424effe25988fea /CMakeLists.txt | |
| parent | c2ec88f93015f688905a0a35b64cc7c29daef223 (diff) | |
| download | raylib-8be93762d9a94a56bf430e0e177bdefb5b1fa0dd.tar.gz raylib-8be93762d9a94a56bf430e0e177bdefb5b1fa0dd.zip | |
Make function calls without prior declaration an error
which is the default behavior on C99 and up.
Diffstat (limited to 'CMakeLists.txt')
| -rwxr-xr-x[-rw-r--r--] | CMakeLists.txt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 82a1ad32..11db057e 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,10 +12,16 @@ else() set (CMAKE_C_STANDARD 99) endif() include(CheckCCompilerFlag) -CHECK_C_COMPILER_FLAG("-Werror=pointer-arith" COMPILER_HAS_POINTER_ARITH_TOGGLE) -if(COMPILER_HAS_POINTER_ARITH_TOGGLE) - set(CMAKE_C_FLAGS "-Werror=pointer-arith ${CMAKE_C_FLAGS}") -endif() +foreach(option -Werror=pointer-arith;-Werror=implicit-function-declaration) + CHECK_C_COMPILER_FLAG("${option}" COMPILER_HAS_THOSE_TOGGLES) + set(outcome "Failed") + if(COMPILER_HAS_THOSE_TOGGLES) + set(CMAKE_C_FLAGS "${option} ${CMAKE_C_FLAGS}") + set(outcome "works") + endif() + message(STATUS "Testing if ${option} can be used -- ${outcome}") +endforeach() + add_subdirectory(src release) |
