Skip to content

Commit ace1254

Browse files
committed
disabling it under windows
1 parent 96c0dcb commit ace1254

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

benchmarks/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ if(teju_has_float128)
3939
endif()
4040
target_link_libraries(benchmark PUBLIC dragonbox::dragonbox_to_chars)
4141
target_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()
4345
target_include_directories(benchmark PUBLIC ${grisu-exact_SOURCE_DIR})

benchmarks/benchmark.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
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) {

dependencies/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)
108108
CPMAddPackage(
109109
NAME errol
110110
GITHUB_REPOSITORY marcandrysco/Errol
@@ -115,3 +115,4 @@ CPMAddPackage(
115115

116116
add_library(errol STATIC "${errol_SOURCE_DIR}/lib/errol.c")
117117
target_include_directories(errol SYSTEM PUBLIC "${errol_SOURCE_DIR}/lib")
118+
endif()

0 commit comments

Comments
 (0)