Skip to content

Commit 87a42b9

Browse files
committed
fixing win32 issue
1 parent ce66812 commit 87a42b9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

benchmarks/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ target_link_libraries(benchmark PUBLIC double-conversion)
77
target_link_libraries(benchmark PUBLIC ryu::ryu)
88
target_link_libraries(benchmark PUBLIC fmt)
99
target_link_libraries(benchmark PUBLIC cxxopts)
10-
target_link_libraries(benchmark PUBLIC netlib)
10+
if(NOT WIN32)
11+
target_link_libraries(benchmark PUBLIC netlib)
12+
target_compile_definitions(benchmark PUBLIC NETLIB_SUPPORTED=1)
13+
endif()
14+
1115
target_link_libraries(benchmark PUBLIC dragonbox::dragonbox_to_chars)
1216

1317
include(CheckSourceCompiles)

benchmarks/benchmark.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#define IEEE_8087
2222
#include "benchutil.h"
2323
#include "cxxopts.hpp"
24+
#if NETLIB_SUPPORTED
2425
#include "gdtoa.h"
26+
#endif
2527
#include "grisu2.h"
2628
#include "random_generators.h"
2729
#include <algorithm>
@@ -69,6 +71,7 @@ void process(std::vector<double> &lines) {
6971
}
7072
return volume;
7173
});
74+
#if NETLIB_SUPPORTED
7275
pretty_print(
7376
lines, "netlib",
7477
[](std::vector<double> &lines) {
@@ -89,6 +92,9 @@ void process(std::vector<double> &lines) {
8992
return volume;
9093
},
9194
10);
95+
#else
96+
std::cout << "# netlib not supported" << std::endl;
97+
#endif
9298
pretty_print(lines, "sprintf", [](std::vector<double> &lines) {
9399
double volume = 0;
94100
char buffer[100];

0 commit comments

Comments
 (0)