mirror of
https://github.com/wassname/ray.git
synced 2026-08-18 12:20:14 +08:00
bazel build --compilation_mode=debug (#6457)
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user