about summary refs log tree commit diff
path: root/third_party/glog/cmake/DetermineGflagsNamespace.cmake
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-02-07T19·15+0300
committertazjin <tazjin@tvl.su>2022-02-07T22·25+0000
commit5ed7ef8089a6914a81b7592d2b6db93c5d87a1e2 (patch)
treed1b86294fd613ed62f131a4ba67bc6e3adf2fc61 /third_party/glog/cmake/DetermineGflagsNamespace.cmake
parent18c8c41b5c2de5a08530b5185cefef86f6ffaff5 (diff)
chore(3p/glog): Unvendor glog r/3784
... and build //third_party/nix with the one from nixpkgs.

Change-Id: Iae7f1772a31286f2c22955cdc1fe61ee82d112aa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3016
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'third_party/glog/cmake/DetermineGflagsNamespace.cmake')
-rw-r--r--third_party/glog/cmake/DetermineGflagsNamespace.cmake69
1 files changed, 0 insertions, 69 deletions
diff --git a/third_party/glog/cmake/DetermineGflagsNamespace.cmake b/third_party/glog/cmake/DetermineGflagsNamespace.cmake
deleted file mode 100644
index 3dde42b4b332..000000000000
--- a/third_party/glog/cmake/DetermineGflagsNamespace.cmake
+++ /dev/null
@@ -1,69 +0,0 @@
-macro(determine_gflags_namespace VARIABLE)
-  if (NOT DEFINED "${VARIABLE}")
-    if (CMAKE_REQUIRED_INCLUDES)
-      set (CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
-    else ()
-      set (CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS)
-    endif ()
-
-    set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
-
-    set(_NAMESPACES gflags google)
-    set(_check_code
-"
-#include <gflags/gflags.h>
-
-int main(int argc, char**argv)
-{
-  GLOG_GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
-}
-")
-    if (NOT CMAKE_REQUIRED_QUIET)
-      message (STATUS "Looking for gflags namespace")
-    endif ()
-    if (${ARGC} EQUAL 3)
-      set (CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
-      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARGV2}")
-    endif ()
-
-    set (_check_file
-        ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/DetermineGflagsNamespace.cxx)
-
-    foreach (_namespace ${_NAMESPACES})
-      file (WRITE "${_check_file}" "${_check_code}")
-      try_compile (${VARIABLE}
-        "${CMAKE_BINARY_DIR}" "${_check_file}"
-        COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}" -DGLOG_GFLAGS_NAMESPACE=${_namespace}
-        LINK_LIBRARIES gflags
-        CMAKE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-        OUTPUT_VARIABLE OUTPUT)
-
-      if (${VARIABLE})
-        set (${VARIABLE} ${_namespace} CACHE INTERNAL "gflags namespace" FORCE)
-        break ()
-      else ()
-        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-          "Determining the gflags namespace ${_namespace} failed with the following output:\n"
-          "${OUTPUT}\n\n")
-      endif ()
-    endforeach (_namespace)
-
-    if (${ARGC} EQUAL 3)
-      set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
-    endif ()
-
-    if (${VARIABLE})
-      if (NOT CMAKE_REQUIRED_QUIET)
-        message (STATUS "Looking for gflags namespace - ${${VARIABLE}}")
-      endif ()
-      file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Determining the gflags namespace passed with the following output:\n"
-        "${OUTPUT}\n\n")
-    else ()
-      if (NOT CMAKE_REQUIRED_QUIET)
-        message (STATUS "Looking for gflags namespace - failed")
-      endif ()
-      set (${VARIABLE} ${_namespace} CACHE INTERNAL "gflags namespace")
-    endif ()
-  endif ()
-endmacro ()