From 714f486065032230bbaf4e7aaaee88d3a46bf31a Mon Sep 17 00:00:00 2001 From: David Sisson Date: Thu, 17 Aug 2023 21:13:26 -0700 Subject: [PATCH] move datetime into a package --- src/substrait/textplan/converter/CMakeLists.txt | 2 ++ src/substrait/textplan/parser/CMakeLists.txt | 2 ++ third_party/CMakeLists.txt | 7 +++---- third_party/datetime | 1 - third_party/datetime.cmake | 13 +++++++++++++ 5 files changed, 20 insertions(+), 5 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 41f3b9ce..5e1cf982 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 498d572c..9d1b1143 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..c2838c9d 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,12 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF}) - set(ABSL_PROPAGATE_CXX_STD ON) - add_subdirectory(abseil-cpp) + set(ABSL_PROPAGATE_CXX_STD ON) + 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..3a02713b --- /dev/null +++ b/third_party/datetime.cmake @@ -0,0 +1,13 @@ +# 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 + ) +#if(NOT ${date_src_POPULATED}) + FetchContent_MakeAvailable(date_src) +#endif()