File tree 7 files changed +1657
-1
lines changed
7 files changed +1657
-1
lines changed Original file line number Diff line number Diff line change 11
11
run : |
12
12
mkdir build &&
13
13
cd build &&
14
- CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON .. &&
14
+ CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON -D FASTFLOAT_BENCHMARKS=ON .. &&
15
15
cmake --build . &&
16
16
ctest --output-on-failure
17
17
- name : Use cmake CXX23
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ project(fast_float VERSION 7.0.0 LANGUAGES CXX)
4
4
set (FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat" )
5
5
set (CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD} )
6
6
option (FASTFLOAT_TEST "Enable tests" OFF )
7
+
7
8
if (FASTFLOAT_TEST)
8
9
enable_testing ()
9
10
add_subdirectory (tests)
@@ -29,6 +30,16 @@ if(FASTFLOAT_INSTALL)
29
30
endif ()
30
31
31
32
add_library (fast_float INTERFACE )
33
+
34
+
35
+ option (FASTFLOAT_BENCHMARKS "Enable benchmarks" OFF )
36
+ if (FASTFLOAT_BENCHMARKS)
37
+ add_subdirectory (benchmarks)
38
+ else (FASTFLOAT_BENCHMARKS)
39
+ message (STATUS "Benchmarks are disabled. Set FASTFLOAT_BENCHMARKS to ON to build benchmarks (assumes C++17)." )
40
+ endif (FASTFLOAT_BENCHMARKS)
41
+
42
+
32
43
add_library (FastFloat::fast_float ALIAS fast_float)
33
44
target_include_directories (
34
45
fast_float
Original file line number Diff line number Diff line change
1
+ add_executable (realbenchmark benchmark.cpp)
2
+ set_property (
3
+ TARGET realbenchmark
4
+ PROPERTY CXX_STANDARD 17)
5
+
6
+ target_link_libraries (realbenchmark PUBLIC fast_float)
7
+ include (ExternalProject)
8
+
9
+ # Define the external project
10
+ ExternalProject_Add(simple_fastfloat_benchmark
11
+ GIT_REPOSITORY https://github.com/lemire/simple_fastfloat_benchmark.git
12
+ GIT_TAG master # or specify a particular commit/tag/branch
13
+ SOURCE_DIR ${CMAKE_BINARY_DIR} /simple_fastfloat_benchmark
14
+ BINARY_DIR ${CMAKE_BINARY_DIR} /simple_fastfloat_benchmark-build
15
+ CONFIGURE_COMMAND ""
16
+ BUILD_COMMAND ""
17
+ INSTALL_COMMAND ""
18
+ )
19
+ set (DATA_DIR ${CMAKE_BINARY_DIR} /simple_fastfloat_benchmark/data)
20
+
21
+ add_custom_target (CopyData ALL
22
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${DATA_DIR} ${CMAKE_CURRENT_BINARY_DIR} /data
23
+ DEPENDS simple_fastfloat_benchmark
24
+ )
25
+ add_dependencies (realbenchmark CopyData)
26
+ target_compile_definitions (realbenchmark PUBLIC BENCHMARK_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR} /data" )
You can’t perform that action at this time.
0 commit comments