cmake_minimum_required(VERSION 3.21)

project(scv C)

include(CTest)

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

if(BUILD_TESTING)
  add_executable(test_scv test/test_scv.c)
  target_link_libraries(test_scv PRIVATE scv)

  add_test(test_scv test_scv)
endif()

cmake_minimum_required(VERSION 3.16)

project(scv C)

include(CTest)

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

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

if(BUILD_TESTING)
  add_executable(test_scv test/test_scv.c)
  target_link_libraries(test_scv PRIVATE scv)

  add_test(test_scv test_scv)
endif()

Add warning flags to CMake list file
Add warning flags to CMake list file

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.
