summaryrefslogtreecommitdiff
path: root/cmake/modules/c_flags.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/c_flags.cmake')
-rw-r--r--cmake/modules/c_flags.cmake13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmake/modules/c_flags.cmake b/cmake/modules/c_flags.cmake
index 5ed0c4d..d30f45e 100644
--- a/cmake/modules/c_flags.cmake
+++ b/cmake/modules/c_flags.cmake
@@ -14,14 +14,13 @@ function(add_cflag_if_supported flag)
if (C_SUPPORTS${flagclean})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
- endif ()
+ endif()
endfunction()
-add_cflag_if_supported("-std=gnu11")
-add_cflag_if_supported("-std=gnu18")
add_cflag_if_supported("-Wall")
add_cflag_if_supported("-Wextra")
add_cflag_if_supported("-Wshadow")
+add_cflag_if_supported("-O")
add_cflag_if_supported("-D_FORTIFY_SOURCE=2")
add_cflag_if_supported("-fstrict-aliasing")
add_cflag_if_supported("-Wundef")
@@ -39,16 +38,14 @@ add_cflag_if_supported("-Wimplicit-function-declaration")
##
if (NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
add_cflag_if_supported("-Wredundant-decls")
-endif ()
+endif()
if (NOT (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)))
add_cflag_if_supported("-fPIC")
-endif ()
+endif()
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_cflag_if_supported("-ggdb")
- add_cflag_if_supported("-O0")
else ()
- add_cflag_if_supported("-O2")
add_cflag_if_supported("-Werror")
-endif ()
+endif()