Skip to content

Commit b399c40

Browse files
committed
We cannot use Dragon4 portably because the author used the header name
Math.h which... works poorly under platforms that cannot distinguish case in file names. Fork.
1 parent ce04599 commit b399c40

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dependencies/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if(NOT WIN32)
22
add_subdirectory(netlib)
33
endif()
44
#add_subdirectory(grisu2)
5-
5+
find_library(MATH_LIBRARY m)
66
include(FetchContent)
77
include(ExternalProject)
88

@@ -79,8 +79,8 @@ FetchContent_MakeAvailable(dragonbox)
7979

8080
FetchContent_Declare(
8181
dragon4
82-
GIT_REPOSITORY https://github.com/ahaldane/Dragon4.git
83-
GIT_TAG 670a3827651c68c9f329d394898b1204cb5ec46f
82+
GIT_REPOSITORY https://github.com/lemire/Dragon4.git
83+
GIT_TAG 0ce72aa
8484
GIT_SHALLOW TRUE
8585
)
8686
FetchContent_GetProperties(dragon4)
@@ -90,9 +90,13 @@ endif()
9090
set(dragon4_SOURCE_DIR ${dragon4_SOURCE_DIR} PARENT_SCOPE)
9191
add_library(dragon4_lib STATIC
9292
${dragon4_SOURCE_DIR}/Dragon4.cpp
93-
${dragon4_SOURCE_DIR}/Math.cpp
93+
${dragon4_SOURCE_DIR}/DragonMath.cpp
9494
${dragon4_SOURCE_DIR}/PrintFloat.cpp
9595
)
96+
if(MATH_LIBRARY)
97+
target_link_libraries(dragon4_lib PUBLIC ${MATH_LIBRARY})
98+
endif()
99+
96100
target_include_directories(dragon4_lib PUBLIC
97101
${dragon4_SOURCE_DIR}
98102
)

0 commit comments

Comments
 (0)