all repos — mgba @ de5ee8cb30d2eb670249f9bfb2f6f7aba1902a68

mGBA Game Boy Advance Emulator

CMake: C is a bad programming language
Vicki Pfau vi@endrift.com
Fri, 26 Feb 2021 00:42:41 -0800
commit

de5ee8cb30d2eb670249f9bfb2f6f7aba1902a68

parent

d42c6e6ba5301ab58bf08d3ea603a28f2d58308a

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -20,13 +20,13 @@ set(CMAKE_C_EXTENSIONS ON)

elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.3") set(CMAKE_C_EXTENSIONS ON) endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-missing-field-initializers") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-field-initializers") + set(WARNING_FLAGS "-Wall -Wextra -Wno-missing-field-initializers") if(WIN32) # mingw32 likes to complain about using the "wrong" format strings despite them actually working - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format") + set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-format") endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146 /wd4267") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146 /wd4267")