From 28c9e39f96190df5643028f21fb1ce5309eca438 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 24 Aug 2023 09:29:42 -0700 Subject: [PATCH] feat: switch datetime package to an external dependency (#83) 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. --- src/substrait/textplan/converter/CMakeLists.txt | 2 ++ src/substrait/textplan/parser/CMakeLists.txt | 2 ++ third_party/CMakeLists.txt | 3 +-- third_party/datetime | 1 - third_party/datetime.cmake | 11 +++++++++++ 5 files changed, 16 insertions(+), 3 deletions(-) delete mode 160000 third_party/datetime create mode 100644 third_party/datetime.cmake diff --git a/src/substrait/textplan/converter/CMakeLists.txt b/src/substrait/textplan/converter/CMakeLists.txt index 6f67271e..5ee27539 100644 --- a/src/substrait/textplan/converter/CMakeLists.txt +++ b/src/substrait/textplan/converter/CMakeLists.txt @@ -1,5 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +include(../../../../third_party/datetime.cmake) + set(TEXTPLAN_SRCS InitialPlanProtoVisitor.cpp InitialPlanProtoVisitor.h diff --git a/src/substrait/textplan/parser/CMakeLists.txt b/src/substrait/textplan/parser/CMakeLists.txt index 4c89fa83..fcc01413 100644 --- a/src/substrait/textplan/parser/CMakeLists.txt +++ b/src/substrait/textplan/parser/CMakeLists.txt @@ -1,5 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +include(../../../../third_party/datetime.cmake) + add_subdirectory(grammar) add_library( diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 7b8d8e60..2124c76d 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -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) diff --git a/third_party/datetime b/third_party/datetime deleted file mode 160000 index cc4685a2..00000000 --- a/third_party/datetime +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc4685a21e4a4fdae707ad1233c61bbaff241f93 diff --git a/third_party/datetime.cmake b/third_party/datetime.cmake new file mode 100644 index 00000000..f96aa06c --- /dev/null +++ b/third_party/datetime.cmake @@ -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)