bazel build --compilation_mode=debug (#6457)

This commit is contained in:
mehrdadn
2020-06-05 14:36:10 +02:00
committed by GitHub
parent 4a6c4003fd
commit d78757623d
5 changed files with 58 additions and 3 deletions
+10
View File
@@ -33,6 +33,16 @@
enum { ERROR = 0 };
#endif
#endif
#if defined(DEBUG) && DEBUG == 1
// Bazel defines the DEBUG macro for historical reasons:
// https://github.com/bazelbuild/bazel/issues/3513#issuecomment-323829248
// Undefine the DEBUG macro to prevent conflicts with our usage below
#undef DEBUG
// Redefine DEBUG as itself to allow any '#ifdef DEBUG' to keep working regardless
#define DEBUG DEBUG
#endif
namespace ray {
enum class RayLogLevel { DEBUG = -1, INFO = 0, WARNING = 1, ERROR = 2, FATAL = 3 };
+18
View File
@@ -0,0 +1,18 @@
// This is to avoid depending on the debug version of the Python library on Windows,
// which requires separate library files and linking.
#if defined(_WIN32) && defined(_DEBUG)
#ifdef Py_PYTHON_H
#error Python.h should not have been included at this point.
#endif
// Ensure some headers included before messing with macro
#include <io.h>
#include <stdio.h>
#ifdef Py_CONFIG_H
#error pyconfig.h should not have been included at this point.
#endif
#include "patchlevel.h"
#pragma push_macro("_DEBUG")
#undef _DEBUG
#include "pyconfig.h"
#pragma pop_macro("_DEBUG")
#endif