Add workaround for Bazel build on macOS
This works around https://github.com/bazelbuild/bazel/issues/3979, and so closes #282.
This commit is contained in:
parent
028d37889a
commit
3106945d8d
@ -53,9 +53,8 @@ def glog_library(namespace='google', with_gflags=1):
|
|||||||
'-Wno-unused-function',
|
'-Wno-unused-function',
|
||||||
'-Wno-unused-local-typedefs',
|
'-Wno-unused-local-typedefs',
|
||||||
'-Wno-unused-variable',
|
'-Wno-unused-variable',
|
||||||
|
"-DGLOG_BAZEL_BUILD",
|
||||||
# Inject a C++ namespace.
|
# Inject a C++ namespace.
|
||||||
"-D_START_GOOGLE_NAMESPACE_='namespace %s {'" % namespace,
|
|
||||||
"-D_END_GOOGLE_NAMESPACE_='}'",
|
|
||||||
"-DGOOGLE_NAMESPACE='%s'" % namespace,
|
"-DGOOGLE_NAMESPACE='%s'" % namespace,
|
||||||
# Allows src/base/mutex.h to include pthread.h.
|
# Allows src/base/mutex.h to include pthread.h.
|
||||||
'-DHAVE_PTHREAD',
|
'-DHAVE_PTHREAD',
|
||||||
|
|||||||
@ -180,8 +180,20 @@
|
|||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#cmakedefine VERSION
|
#cmakedefine VERSION
|
||||||
|
|
||||||
|
#ifdef GLOG_BAZEL_BUILD
|
||||||
|
|
||||||
|
/* TODO(rodrigoq): remove this workaround once bazel#3979 is resolved:
|
||||||
|
* https://github.com/bazelbuild/bazel/issues/3979 */
|
||||||
|
#define _START_GOOGLE_NAMESPACE_ namespace GOOGLE_NAMESPACE {
|
||||||
|
|
||||||
|
#define _END_GOOGLE_NAMESPACE_ }
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
/* Stops putting the code inside the Google namespace */
|
/* Stops putting the code inside the Google namespace */
|
||||||
#cmakedefine _END_GOOGLE_NAMESPACE_ ${_END_GOOGLE_NAMESPACE_}
|
#cmakedefine _END_GOOGLE_NAMESPACE_ ${_END_GOOGLE_NAMESPACE_}
|
||||||
|
|
||||||
/* Puts following code inside the Google namespace */
|
/* Puts following code inside the Google namespace */
|
||||||
#cmakedefine _START_GOOGLE_NAMESPACE_ ${_START_GOOGLE_NAMESPACE_}
|
#cmakedefine _START_GOOGLE_NAMESPACE_ ${_START_GOOGLE_NAMESPACE_}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user