From 86d86462b420f098ee34a022cffd922e3192dabe Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sun, 1 Jan 2023 20:08:31 +0100 Subject: Remove ANSI C option; add pedantic gcc flag --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 33b42fe..770e79d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,16 +7,10 @@ if(NOT DEFINED CMAKE_BUILD_PARALLEL_LEVEL) endif() option(KIT_ENABLE_TESTING "Enable testing" ON) -option(KIT_FORCE_ANSI_C "Force ANSI C" ${KIT_ENABLE_TESTING}) option(KIT_DISABLE_SYSTEM_MALLOC "Disable system memory allocator" OFF) option(KIT_DISABLE_SYSTEM_THREADS "Disable system threads" OFF) -if(KIT_FORCE_ANSI_C) - set(CMAKE_C_STANDARD 90) - set(CMAKE_C_EXTENSIONS OFF) -endif() - project( kit VERSION 0.1.1 @@ -32,6 +26,10 @@ if(WIN32) target_link_libraries(kit PUBLIC Shlwapi) endif() +if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + target_compile_options(kit PUBLIC -pedantic -Wall -Werror) +endif() + include(CheckCSourceRuns) check_c_source_runs( -- cgit v1.2.3