Skip to content

Commit 66b31a2

Browse files
committed
add Drachennest dep. for schubfach/dragon4 impl.
1 parent a1abe35 commit 66b31a2

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_C_STANDARD 99)
77
set(CMAKE_C_STANDARD_REQUIRED ON)
88

9+
cmake_policy(SET CMP0169 OLD) # Prevent warning when using FetchContent_Populate
10+
911
if (NOT CMAKE_BUILD_TYPE)
1012
message(STATUS "No build type selected, default to Release")
1113
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)

benchmarks/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ if(teju_has_float128)
3838
target_link_libraries(benchmark PUBLIC teju_boost_multiprecision)
3939
endif()
4040
target_link_libraries(benchmark PUBLIC dragonbox::dragonbox_to_chars)
41+
target_link_libraries(benchmark PUBLIC dragon_schubfach_lib)
4142

4243
target_include_directories(benchmark PUBLIC ${grisu-exact_SOURCE_DIR})

dependencies/CMakeLists.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
3030
FetchContent_Declare(
3131
doubleconversion
3232
GIT_REPOSITORY https://github.com/google/double-conversion.git
33-
GIT_TAG "v3.1.5")
33+
GIT_TAG "v3.1.5"
34+
GIT_SHALLOW TRUE
35+
)
3436
FetchContent_MakeAvailable(doubleconversion)
3537

3638
FetchContent_Declare(
@@ -48,6 +50,7 @@ if(teju_has_float128)
4850
else()
4951
message(STATUS "support for 128-bit floats NOT detected by teju")
5052
endif()
53+
5154
#CPMAddPackage("gh:ulfjack/[email protected]")
5255
FetchContent_Declare(
5356
ryu
@@ -74,6 +77,26 @@ FetchContent_Declare(
7477
)
7578
FetchContent_MakeAvailable(dragonbox)
7679

80+
FetchContent_Declare(
81+
drachennest # for schubfach and dragon4
82+
GIT_REPOSITORY https://github.com/abolz/Drachennest.git
83+
GIT_TAG master
84+
GIT_SHALLOW TRUE
85+
)
86+
FetchContent_GetProperties(drachennest)
87+
if(NOT drachennest_POPULATED)
88+
FetchContent_Populate(drachennest) # Downloads code to ${drachennest_SOURCE_DIR}
89+
endif()
90+
set(drachennest_SOURCE_DIR/src ${drachennest_SOURCE_DIR}/src PARENT_SCOPE)
91+
add_library(dragon_schubfach_lib STATIC
92+
${drachennest_SOURCE_DIR}/src/dragon4.cc
93+
${drachennest_SOURCE_DIR}/src/schubfach_32.cc
94+
${drachennest_SOURCE_DIR}/src/schubfach_64.cc
95+
)
96+
target_include_directories(dragon_schubfach_lib PUBLIC
97+
${drachennest_SOURCE_DIR}/src
98+
)
99+
77100
CPMAddPackage("gh:fmtlib/fmt#11.0.2")
78101
CPMAddPackage(
79102
GITHUB_REPOSITORY jarro2783/cxxopts

0 commit comments

Comments
 (0)