Search code examples
c++macosbazelglog

glog throws invalid token at start of a preprocessor expression '@'


I am using Bazel importing glog in the workspace as:

git_repository(
    name = "com_github_glog_glog",
    commit = "3106945d8d3322e5cbd5658d482c9ffed2d892c0",
    remote = "https://github.com/google/glog.git",
)

bind(
    name = "glog",
    actual = "@com_github_glog_glog//:glog",
)

When building glog directly (bazel build external:glog) it works fine, however, when I try to use it as a dependency in one of my build targets I get the following error:

bazel-out/darwin-fastbuild/bin/external/com_github_glog_glog/_virtual_includes/glog/glog/stl_logging.h:50:6: error: invalid token at start of a preprocessor expression
#if !@ac_cv_cxx_using_operator@
     ^

I am on macOS 10.13.2.

Any thoughts on how to address this? Is it an issue with the compiler on macOS?


Solution

  • This was a bug in glog solved by https://github.com/google/glog/pull/291