From 686a39df387806c85664cb48a353bef5d41b810c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 31 Oct 2021 04:29:40 +0100 Subject: [PATCH] CMakeLists.txt: slightly modernize --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc2d146..ec97e26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required (VERSION 3.0) +# Ubuntu 18.04 LTS and OpenBSD 6.4 +cmake_minimum_required (VERSION 3.10) project (uirc3 VERSION 1.4.0 LANGUAGES C) # Options @@ -6,10 +7,13 @@ option (WANT_READLINE "Use GNU Readline for the UI (better)" ON) option (WANT_LIBEDIT "Use BSD libedit for the UI" OFF) # Moar warnings +set (CMAKE_C_STANDARD 99) +set (CMAKE_C_STANDARD_REQUIRED ON) +set (CMAKE_C_EXTENSIONS OFF) + if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC) # -Wunused-function is pretty annoying here, as everything is static - set (wdisabled "-Wno-unused-function") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra ${wdisabled}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function") endif () # Version