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 40ea6bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 40ea6bb

Please sign in to comment.