Allow using glog/stl_logging.h with Bazel
[platform/upstream/glog.git] / bazel / glog.bzl
index 37e5320..b33f1aa 100644 (file)
@@ -46,8 +46,6 @@ def glog_library(namespace='google', with_gflags=1):
             ':vlog_is_on_h',
             'src/glog/log_severity.h',
         ],
-        textual_hdrs = [
-        ],
         strip_include_prefix = 'src',
         copts = [
             # Disable warnings that exists in glog.
@@ -55,9 +53,8 @@ def glog_library(namespace='google', with_gflags=1):
             '-Wno-unused-function',
             '-Wno-unused-local-typedefs',
             '-Wno-unused-variable',
+            "-DGLOG_BAZEL_BUILD",
             # Inject a C++ namespace.
-            "-D_START_GOOGLE_NAMESPACE_='namespace %s {'" % namespace,
-            "-D_END_GOOGLE_NAMESPACE_='}'",
             "-DGOOGLE_NAMESPACE='%s'" % namespace,
             # Allows src/base/mutex.h to include pthread.h.
             '-DHAVE_PTHREAD',
@@ -92,7 +89,8 @@ def glog_library(namespace='google', with_gflags=1):
         cmd = r'''\
 #!/bin/sh
 cat > $@ <<"EOF"
-sed -e 's/@ac_cv_have_unistd_h@/1/g' \
+sed -e 's/@ac_cv_cxx_using_operator@/1/g' \
+    -e 's/@ac_cv_have_unistd_h@/1/g' \
     -e 's/@ac_cv_have_stdint_h@/1/g' \
     -e 's/@ac_cv_have_systypes_h@/1/g' \
     -e 's/@ac_cv_have_libgflags_h@/1/g' \
@@ -115,7 +113,7 @@ EOF
             'src/config.h.cmake.in',
         ],
         outs = [
-            'glog_internal/src/config.h',
+            'glog_internal/config.h',
         ],
         cmd = "awk '{ gsub(/^#cmakedefine/, \"//cmakedefine\"); print; }' $< > $@",
     )