Skip to content

Commit 7c3108d

Browse files
lemirejaja360
authored andcommitted
slightly nicer
1 parent 3fe4c27 commit 7c3108d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

benchmarks/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ int main(void) {
1414
std::from_chars_result result2 = std::from_chars(ptr, ptr, valued, std::chars_format::general);
1515
return 0;
1616
}
17-
" from_chars_ok)
18-
target_compile_definitions(benchmark PUBLIC FROM_CHARS_SUPPORTED=$<IF:$<BOOL:${from_chars_ok}>,1,0>)
17+
" FROM_CHARS_OK)
18+
target_compile_definitions(benchmark PUBLIC FROM_CHARS_SUPPORTED=$<IF:$<BOOL:${FROM_CHARS_OK}>,1,0>)
1919
check_source_compiles(CXX "
2020
#include <charconv>
2121
int main(void) {
@@ -26,9 +26,18 @@ int main(void) {
2626
std::to_chars_result result2 = std::to_chars(ptr, ptr, valued);
2727
return 0;
2828
}
29-
" to_chars)
30-
target_compile_definitions(benchmark PUBLIC TO_CHARS_SUPPORTED=$<IF:$<BOOL:${to_chars}>,1,0>)
31-
29+
" TO_CHARS_OK)
30+
target_compile_definitions(benchmark PUBLIC TO_CHARS_SUPPORTED=$<IF:$<BOOL:${TO_CHARS_OK}>,1,0>)
31+
if(TO_CHARS_OK)
32+
message(STATUS "std::to_chars with floats is supported")
33+
else(TO_CHARS_OK)
34+
message(STATUS "std::to_chars with floats is NOT supported")
35+
endif(TO_CHARS_OK)
36+
if(FROM_CHARS_OK)
37+
message(STATUS "std::from_chars with floats is supported")
38+
else(FROM_CHARS_OK)
39+
message(STATUS "std::from_chars with floats is NOT supported")
40+
endif(FROM_CHARS_OK)
3241
CPMAddPackage(
3342
NAME fast_float
3443
GITHUB_REPOSITORY "fastfloat/fast_float"

0 commit comments

Comments
 (0)