Skip to content

Commit

Permalink
Add warning flags to CMake list file
Browse files Browse the repository at this point in the history
Settle on a CMake minimum version of 3.16, which is the version in
Ubuntu 20.04. It includes the change to MSVC default compiler flags
so we can set our own warning level.
  • Loading branch information
jibsen committed Feb 2, 2022
1 parent 1529e3c commit 176dc50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.16)

project(parg C)

include(CTest)

if(MSVC)
add_compile_options(/W3)
else()
add_compile_options(-Wall -Wextra -pedantic)
endif()

add_library(parg parg.c parg.h)
target_include_directories(parg PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)

Expand Down

0 comments on commit 176dc50

Please sign in to comment.