Allow using glog/stl_logging.h with Bazel
[platform/upstream/glog.git] / bazel / glog.bzl
index e0b633c..b33f1aa 100644 (file)
@@ -53,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',
@@ -90,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' \
@@ -113,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; }' $< > $@",
     )