From 55d4c4171d397f8e6750fa54528500a6083380ae Mon Sep 17 00:00:00 2001 From: Anton Anikin Date: Tue, 8 Jul 2025 20:09:57 +0800 Subject: [PATCH] small cmake fixes --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d4898e..b18080a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.11) # FetchContent project(keycode) +enable_language(CXX) +set(CMAKE_CXX_STANDARD 17) + include(FetchContent) include("cmake/Check-from_chars.cmake") @@ -12,6 +15,7 @@ if (NOT DEFINED OPTCON_LOCAL_BUILD) fmt GIT_REPOSITORY https://github.com/fmtlib/fmt GIT_TAG 123913715afeb8a437e6388b4473fcc4753e1c9a # 11.1.4 + SYSTEM ) FetchContent_MakeAvailable(fmt) @@ -22,6 +26,7 @@ if (NOT FROM_CHARS_WORKS) fast_float GIT_REPOSITORY https://github.com/fastfloat/fast_float GIT_TAG 77cc847c842c49e7e3477c1e95da2b6540166d66 # 8.0.0 + SYSTEM ) FetchContent_MakeAvailable(fast_float) @@ -30,6 +35,13 @@ if (NOT FROM_CHARS_WORKS) add_definitions(-DUSE_FAST_FLOAT) endif() +if (MSVC) + # https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170 + add_compile_options(/Wall) +else() + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + add_library(keycode STATIC src/array.cpp src/keycode.c