Skip to content

Commit

Permalink
feat: switch datetime package to an external dependency (substrait-io#83
Browse files Browse the repository at this point in the history
)

By switching to an external dependency controlled by a central file we
can more cleanly reference date::date and date::tz. We could do the same
by "externally loading" a submodule but either way we end up downloading
the datetime repo.
  • Loading branch information
EpsilonPrime authored Aug 24, 2023
1 parent 362552d commit cf6052b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/substrait/textplan/converter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

include(../../../../third_party/datetime.cmake)

set(TEXTPLAN_SRCS
InitialPlanProtoVisitor.cpp
InitialPlanProtoVisitor.h
Expand Down
2 changes: 2 additions & 0 deletions src/substrait/textplan/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

include(../../../../third_party/datetime.cmake)

add_subdirectory(grammar)

add_library(
Expand Down
3 changes: 1 addition & 2 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF})
add_subdirectory(abseil-cpp)
endif()

set(BUILD_TZ_LIB ON)
add_subdirectory(datetime)
include(datetime.cmake)

add_subdirectory(fmt)
add_subdirectory(googletest)
Expand Down
1 change: 0 additions & 1 deletion third_party/datetime
Submodule datetime deleted from cc4685
11 changes: 11 additions & 0 deletions third_party/datetime.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

include_guard(GLOBAL)

set (BUILD_TZ_LIB ON CACHE BOOL "timezone library is a dependency" FORCE)
include(FetchContent)
FetchContent_Declare(date_src
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
GIT_TAG v3.0.1
)
FetchContent_MakeAvailable(date_src)

0 comments on commit cf6052b

Please sign in to comment.