small cmake fixes
This commit is contained in:
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.11) # FetchContent
|
|||||||
|
|
||||||
project(keycode)
|
project(keycode)
|
||||||
|
|
||||||
|
enable_language(CXX)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
include("cmake/Check-from_chars.cmake")
|
include("cmake/Check-from_chars.cmake")
|
||||||
|
|
||||||
@@ -12,6 +15,7 @@ if (NOT DEFINED OPTCON_LOCAL_BUILD)
|
|||||||
fmt
|
fmt
|
||||||
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
GIT_REPOSITORY https://github.com/fmtlib/fmt
|
||||||
GIT_TAG 123913715afeb8a437e6388b4473fcc4753e1c9a # 11.1.4
|
GIT_TAG 123913715afeb8a437e6388b4473fcc4753e1c9a # 11.1.4
|
||||||
|
SYSTEM
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(fmt)
|
FetchContent_MakeAvailable(fmt)
|
||||||
@@ -22,6 +26,7 @@ if (NOT FROM_CHARS_WORKS)
|
|||||||
fast_float
|
fast_float
|
||||||
GIT_REPOSITORY https://github.com/fastfloat/fast_float
|
GIT_REPOSITORY https://github.com/fastfloat/fast_float
|
||||||
GIT_TAG 77cc847c842c49e7e3477c1e95da2b6540166d66 # 8.0.0
|
GIT_TAG 77cc847c842c49e7e3477c1e95da2b6540166d66 # 8.0.0
|
||||||
|
SYSTEM
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(fast_float)
|
FetchContent_MakeAvailable(fast_float)
|
||||||
@@ -30,6 +35,13 @@ if (NOT FROM_CHARS_WORKS)
|
|||||||
add_definitions(-DUSE_FAST_FLOAT)
|
add_definitions(-DUSE_FAST_FLOAT)
|
||||||
endif()
|
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
|
add_library(keycode STATIC
|
||||||
src/array.cpp
|
src/array.cpp
|
||||||
src/keycode.c
|
src/keycode.c
|
||||||
|
|||||||
Reference in New Issue
Block a user