Added support for setting the debug level in ODPI-C, if desirable, by setting

an environment variable prior to building cx_Oracle.
This commit is contained in:
Anthony Tuininga 2017-05-19 21:26:07 -06:00
parent 999913be35
commit 14a1d2d0c9
2 changed files with 8 additions and 1 deletions

2
odpi

@ -1 +1 @@
Subproject commit 07b43d059ab2502ebc5c98c26ddecfe63cb0861d Subproject commit c899a6659271eec50be378e16022ce38be32462c

View File

@ -54,6 +54,12 @@ elif sys.platform == "cygwin":
elif sys.platform == "darwin": elif sys.platform == "darwin":
extraLinkArgs.append("-shared-libgcc") extraLinkArgs.append("-shared-libgcc")
# setup ODPI-C debugging, if desirable
defines = []
debugLevelName = "DPI_DEBUG_LEVEL"
if debugLevelName in os.environ:
defines = [(debugLevelName, os.environ[debugLevelName])]
class test(distutils.core.Command): class test(distutils.core.Command):
description = "run the test suite for the extension" description = "run the test suite for the extension"
user_options = [] user_options = []
@ -92,6 +98,7 @@ extension = Extension(
include_dirs = ["odpi/include", "odpi/src"], include_dirs = ["odpi/include", "odpi/src"],
extra_compile_args = extraCompileArgs, extra_compile_args = extraCompileArgs,
extra_link_args = extraLinkArgs, extra_link_args = extraLinkArgs,
define_macros = defines,
sources = ["src/cx_Oracle.c"], sources = ["src/cx_Oracle.c"],
depends = ["src/BooleanVar.c", "src/Buffer.c", "src/Connection.c", depends = ["src/BooleanVar.c", "src/Buffer.c", "src/Connection.c",
"src/Cursor.c", "src/CursorVar.c", "src/DateTimeVar.c", "src/Cursor.c", "src/CursorVar.c", "src/DateTimeVar.c",