Skip to content

Commit

Permalink
Export CMake cache variable with the to_numeric-check results for dow…
Browse files Browse the repository at this point in the history
…nstream, header-only projects
  • Loading branch information
csparker247 committed Jun 24, 2024
1 parent c6dd97b commit 4c089e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(EduceLabCore VERSION 0.2.0)
project(EduceLabCore VERSION 0.2.1)

# Setup project directories
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
Expand Down
4 changes: 2 additions & 2 deletions cmake/CheckToNumericFP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ if(CXX_CHARCONV_FP_FROM_CHARS)
message(STATUS "Float implementation for to_numeric: std::from_chars")
else()
message(STATUS "Float implementation for to_numeric: std::sto[f|d|ld]")
set(EDUCELAB_NEED_TO_NUMERIC_FP TRUE)
add_compile_definitions(EDUCELAB_NEED_TO_NUMERIC_FP)
set(EDUCE_CORE_NEED_TO_NUMERIC_FP TRUE CACHE BOOL "Float implementations for to_numeric will use std::sto[f|d|ld]")
add_compile_definitions(EDUCE_CORE_NEED_TO_NUMERIC_FP)
endif()
2 changes: 1 addition & 1 deletion include/educelab/core/utils/String.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ auto to_numeric(const std::string_view str, Args... args) -> T
return val;
}

#ifdef EDUCELAB_NEED_TO_NUMERIC_FP
#ifdef EDUCE_CORE_NEED_TO_NUMERIC_FP
/**
* @copybrief to_numeric
*
Expand Down

0 comments on commit 4c089e0

Please sign in to comment.