Skip to content

Commit 14a1d2d

Browse files
Added support for setting the debug level in ODPI-C, if desirable, by setting
an environment variable prior to building cx_Oracle.
1 parent 999913b commit 14a1d2d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
elif sys.platform == "darwin":
5555
extraLinkArgs.append("-shared-libgcc")
5656

57+
# setup ODPI-C debugging, if desirable
58+
defines = []
59+
debugLevelName = "DPI_DEBUG_LEVEL"
60+
if debugLevelName in os.environ:
61+
defines = [(debugLevelName, os.environ[debugLevelName])]
62+
5763
class test(distutils.core.Command):
5864
description = "run the test suite for the extension"
5965
user_options = []
@@ -92,6 +98,7 @@ def run(self):
9298
include_dirs = ["odpi/include", "odpi/src"],
9399
extra_compile_args = extraCompileArgs,
94100
extra_link_args = extraLinkArgs,
101+
define_macros = defines,
95102
sources = ["src/cx_Oracle.c"],
96103
depends = ["src/BooleanVar.c", "src/Buffer.c", "src/Connection.c",
97104
"src/Cursor.c", "src/CursorVar.c", "src/DateTimeVar.c",

0 commit comments

Comments
 (0)