diff options
| author | Ahmad Fatoum <[email protected]> | 2018-01-18 13:22:41 +0100 |
|---|---|---|
| committer | Ahmad Fatoum <[email protected]> | 2018-01-18 13:22:41 +0100 |
| commit | 30ef3f3122dc05e8a950d21c4b098208d73e456b (patch) | |
| tree | e19d5ae87aabb65d1662ef558524f2d3e3f8e495 /CMakeLists.txt | |
| parent | a2edc9d64191d9b9253ee7faa5f80cd742f769b2 (diff) | |
| download | raylib-30ef3f3122dc05e8a950d21c4b098208d73e456b.tar.gz raylib-30ef3f3122dc05e8a950d21c4b098208d73e456b.zip | |
GCC/Clang: Treat void pointer arithmetic as error
As an extension, GNU C treats sizeof(void) as 1. MSVC doesn't.
Make it an error on GCC/Clang to avoid accidental MSVC breakage.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 057481bd..82a1ad32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,11 @@ if(CMAKE_VERSION VERSION_LESS "3.1") 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() add_subdirectory(src release) |
