This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
forked from miloyip/dtoa-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
181 lines (161 loc) · 4.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
cmake_minimum_required(VERSION 3.8.2)
cmake_policy(SET CMP0054 NEW)
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
project(d2a-benchmark C CXX)
#
# Set default build type to Release. This is to ease a User's life.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPERCASE)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
set(SOURCES
src/stb_test.cpp src/stb/stb_sprintf.h
src/double-conversion/bignum.cc
src/double-conversion/bignum-dtoa.cc
src/double-conversion/bignum-dtoa.h
src/double-conversion/bignum.h
src/double-conversion/cached-powers.cc
src/double-conversion/cached-powers.h
src/double-conversion/diy-fp.h
src/double-conversion/double-conversion.h
src/double-conversion/double-to-string.cc
src/double-conversion/double-to-string.h
src/double-conversion/fast-dtoa.cc
src/double-conversion/fast-dtoa.h
src/double-conversion/fixed-dtoa.cc
src/double-conversion/fixed-dtoa.h
src/double-conversion/ieee.h
src/double-conversion/string-to-double.cc
src/double-conversion/string-to-double.h
src/double-conversion/strtod.cc
src/double-conversion/strtod.h
src/double-conversion/utils.h
src/doubleconvtest.cpp
src/emyg/emyg_dtoa.c
src/emyg/emyg_dtoa.h
src/emygtest.cpp
src/erthink/erthink.h
src/erthink/erthink_arch.h
src/erthink/erthink_bswap.h
src/erthink/erthink_byteorder.h
src/erthink/erthink_carryadd.h
src/erthink/erthink_clz.h
src/erthink/erthink_d2a.h
src/erthink/erthink_defs.h
src/erthink/erthink_intrin.h
src/erthink/erthink_misc.h
src/erthink/erthink_mul.h
src/erthink/erthink_rot.h
src/erthink/erthink_u2a.h
src/erthink_test.cpp
src/ryu/common.h
src/ryu/d2fixed.c
src/ryu/d2fixed_full_table.h
src/ryu/d2s.c
src/ryu/d2s_full_table.h
src/ryu/d2s_intrinsics.h
src/ryu/d2s_small_table.h
src/ryu/digit_table.h
src/ryu/f2s.c
src/ryu/f2s_full_table.h
src/ryu/generic_128.c
src/ryu/generic_128.h
src/ryu/ryu_generic_128.h
src/ryu/ryu.h
src/ryu/ryu_parse.h
src/ryu/s2d.c
src/ryu_test.cpp
src/floaxie/atof.h
src/floaxie/bit_ops.h
src/floaxie/cached_power.h
src/floaxie/conversion_status.h
src/floaxie/default_fallback.h
src/floaxie/diy_fp.h
src/floaxie/fraction.h
src/floaxie/ftoa.h
src/floaxie/grisu.h
src/floaxie/huge_val.h
src/floaxie/integer_of_size.h
src/floaxie/k_comp.h
src/floaxie/krosh.h
src/floaxie/memwrap.h
src/floaxie/powers_ten.h
src/floaxie/powers_ten_double.h
src/floaxie/powers_ten_single.h
src/floaxie/prettify.h
src/floaxie/print.h
src/floaxie/static_pow.h
src/floaxie/type_punning_cast.h
src/floaxietest.cpp
src/fmt/chrono.h
src/fmt/color.h
src/fmt/compile.h
src/fmt/core.h
src/fmt/format.h
src/fmt/format-inl.h
src/fmt/locale.h
src/fmt/os.h
src/fmt/ostream.h
src/fmt/posix.h
src/fmt/printf.h
src/fmt/ranges.h
src/fmt/format.cc
src/fmt/os.cc
src/fmttest.cpp
src/fpconv/fpconv.c
src/fpconv/fpconv.h
src/fpconv/license
src/fpconv/powers.h
src/fpconvtest.cpp
src/gay/dtoa.c
src/gay/g_fmt.c
src/gaytest.cpp
src/grisu/diy_fp.h
src/grisu/double.h
src/grisu/fast_exponent.h
src/grisu/grisu2.h
src/grisu/grisu2b_59_56.c
src/grisu/k_comp.h
src/grisu/powers.h
src/grisu/powers_ten_round64.h
src/grisu/prettify.h
src/grisu2btest.cpp
src/milo/dtoa_milo.h src/milotest.cpp
src/msinttypes/inttypes.h src/msinttypes/stdint.h
src/ostringstream.cpp
src/ostrstream.cpp
src/sprintf.cpp
src/resultfilename.h
src/test.h
src/timer.h
src/null.cpp
src/main.cpp
)
add_executable(d2a-benchmark ${SOURCES})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_definitions(d2a-benchmark PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
if(NOT DEFINED CXX_STANDARD)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_17 HAS_CXX17)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_14 HAS_CXX14)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_11 HAS_CXX11)
if(NOT HAS_CXX17 LESS 0)
set(CXX_STANDARD 17)
elseif(NOT HAS_CXX14 LESS 0)
set(CXX_STANDARD 14)
elseif(NOT HAS_CXX11 LESS 0)
set(CXX_STANDARD 11)
endif()
endif()
if(DEFINED CXX_STANDARD)
message(STATUS "Use C++${CXX_STANDARD}")
target_compile_features(d2a-benchmark PRIVATE cxx_std_11)
endif()