File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -39,5 +39,7 @@ if(teju_has_float128)
3939endif ()
4040target_link_libraries (benchmark PUBLIC dragonbox::dragonbox_to_chars)
4141target_link_libraries (benchmark PUBLIC dragon_schubfach_lib)
42- target_link_libraries (benchmark PUBLIC errol)
42+ if (TARGET errol)
43+ target_link_libraries (benchmark PUBLIC errol)
44+ endif ()
4345target_include_directories (benchmark PUBLIC ${grisu-exact_SOURCE_DIR})
Original file line number Diff line number Diff line change 2020#include " grisu_exact.h"
2121#include " dragon4.h"
2222#include " schubfach_64.h"
23+ #if __has_include("errol.h")
2324#include " errol.h"
25+ #define ERROL_SUPPORTED 1
26+ #else
27+ #define ERROL_SUPPORTED 0
28+ #endif
2429
2530#define IEEE_8087
2631#include " benchutil.h"
@@ -67,7 +72,8 @@ void process(std::vector<double> &lines) {
6772 }
6873 return volume;
6974 });
70-
75+
76+ #if ERROL_SUPPORTED
7177 pretty_print (lines, " errol3" , [](const std::vector<double > &lines) {
7278 double volume = 0 ;
7379 char buffer[100 ];
@@ -77,7 +83,9 @@ void process(std::vector<double> &lines) {
7783 }
7884 return volume;
7985 });
80-
86+ #else
87+ std::cout << " # errol not supported" << std::endl;
88+ #endif // ERROL_SUPPORTED
8189 pretty_print (lines, " std::to_string" , [](const std::vector<double > &lines) {
8290 double volume = 0 ;
8391 for (const auto d : lines) {
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ CPMAddPackage(
104104 OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
105105)
106106
107-
107+ if ( NOT WIN32 )
108108CPMAddPackage(
109109 NAME errol
110110 GITHUB_REPOSITORY marcandrysco/Errol
@@ -115,3 +115,4 @@ CPMAddPackage(
115115
116116add_library (errol STATIC "${errol_SOURCE_DIR} /lib/errol.c" )
117117target_include_directories (errol SYSTEM PUBLIC "${errol_SOURCE_DIR} /lib" )
118+ endif ()
You can’t perform that action at this time.
0 commit comments