You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2024/02/29 15:19:00 UTC
(arrow) branch main updated: GH-40274: [C++] Add support for system glog 0.7 (#40275)
This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 7e691d5078 GH-40274: [C++] Add support for system glog 0.7 (#40275)
7e691d5078 is described below
commit 7e691d5078850b007f649059be65e5c016aab80b
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Fri Mar 1 00:18:53 2024 +0900
GH-40274: [C++] Add support for system glog 0.7 (#40275)
### Rationale for this change
glog uses "glog" not "GLOG" as CMake package name. So we should follow it.
### What changes are included in this PR?
Use "glogAlt" for our glog CMake module name to distinct upstream's CMake package name.
### Are these changes tested?
No. We don't have CI with glog 0.7 yet.
### Are there any user-facing changes?
Yes.
* GitHub Issue: #40274
Lead-authored-by: Sutou Kouhei <ko...@clear-code.com>
Co-authored-by: Sutou Kouhei <ko...@cozmixng.org>
Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
.../{FindGLOG.cmake => FindglogAlt.cmake} | 20 ++++++++++++++------
cpp/cmake_modules/ThirdpartyToolchain.cmake | 18 +++++++++++++++---
2 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/cpp/cmake_modules/FindGLOG.cmake b/cpp/cmake_modules/FindglogAlt.cmake
similarity index 83%
rename from cpp/cmake_modules/FindGLOG.cmake
rename to cpp/cmake_modules/FindglogAlt.cmake
index 62b235ee91..eb16636add 100644
--- a/cpp/cmake_modules/FindGLOG.cmake
+++ b/cpp/cmake_modules/FindglogAlt.cmake
@@ -15,14 +15,22 @@
#
# Usage of this module as follows:
#
-# find_package(GLOG)
+# find_package(glogAlt)
-find_package(glog CONFIG)
-if(glog_FOUND)
+if(glogAlt_FOUND)
return()
endif()
-if(GLOG_FOUND)
+set(find_package_args CONFIG)
+if(glogAlt_FIND_VERSION)
+ list(APPEND find_package_args ${glogAlt_FIND_VERSION})
+endif()
+if(glogAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(glog ${find_package_args})
+if(glog_FOUND)
+ set(glogAlt_FOUND TRUE)
return()
endif()
@@ -55,9 +63,9 @@ else()
PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES})
endif()
-find_package_handle_standard_args(GLOG REQUIRED_VARS GLOG_INCLUDE_DIR GLOG_LIB)
+find_package_handle_standard_args(glogAlt REQUIRED_VARS GLOG_INCLUDE_DIR GLOG_LIB)
-if(GLOG_FOUND)
+if(glogAlt_FOUND)
add_library(glog::glog UNKNOWN IMPORTED)
set_target_properties(glog::glog
PROPERTIES IMPORTED_LOCATION "${GLOG_LIB}"
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 454d94d64b..b6b6ac18ea 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -51,7 +51,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
BZip2
c-ares
gflags
- GLOG
+ glog
google_cloud_cpp_storage
gRPC
GTest
@@ -111,6 +111,14 @@ if("${lz4_SOURCE}" STREQUAL "" AND NOT "${Lz4_SOURCE}" STREQUAL "")
set(lz4_SOURCE ${Lz4_SOURCE})
endif()
+# For backward compatibility. We use "GLOG_SOURCE" if "glog_SOURCE"
+# isn't specified and "GLOG_SOURCE" is specified.
+# We renamed "GLOG" dependency name to "glog" in 16.0.0 because
+# upstream uses "glog" not "GLOG" as package name.
+if("${glog_SOURCE}" STREQUAL "" AND NOT "${GLOG_SOURCE}" STREQUAL "")
+ set(glog_SOURCE ${GLOG_SOURCE})
+endif()
+
# For backward compatibility. We use bundled jemalloc by default.
if("${jemalloc_SOURCE}" STREQUAL "")
set(jemalloc_SOURCE "BUNDLED")
@@ -180,7 +188,7 @@ macro(build_dependency DEPENDENCY_NAME)
build_cares()
elseif("${DEPENDENCY_NAME}" STREQUAL "gflags")
build_gflags()
- elseif("${DEPENDENCY_NAME}" STREQUAL "GLOG")
+ elseif("${DEPENDENCY_NAME}" STREQUAL "glog")
build_glog()
elseif("${DEPENDENCY_NAME}" STREQUAL "google_cloud_cpp_storage")
build_google_cloud_cpp_storage()
@@ -1528,7 +1536,11 @@ macro(build_glog)
endmacro()
if(ARROW_USE_GLOG)
- resolve_dependency(GLOG PC_PACKAGE_NAMES libglog)
+ resolve_dependency(glog
+ HAVE_ALT
+ TRUE
+ PC_PACKAGE_NAMES
+ libglog)
endif()
# ----------------------------------------------------------------------