Commit 3ae58fea authored by vorfol's avatar vorfol Committed by Stefan Behnel

Use CFLAGS for compiler defines in test runner (GH-4099)

Creating global CDEFS for holding compiler definitions. Then pass it to the distutils.

Also add .vscode folder to .gitignore

Fixes https://github.com/cython/cython/issues/4096
parent 2419d61c
......@@ -41,3 +41,5 @@ MANIFEST
/.idea
/*.iml
# Visual Studio Code files
.vscode
......@@ -432,6 +432,7 @@ VER_DEP_MODULES = {
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split()
CCACHE = os.getenv('CYTHON_RUNTESTS_CCACHE', '').split()
CDEFS = []
TEST_SUPPORT_DIR = 'testsupport'
BACKENDS = ['c', 'cpp']
......@@ -1052,6 +1053,7 @@ class CythonCompileTestCase(unittest.TestCase):
build_extension.compiler = COMPILER
ext_compile_flags = CFLAGS[:]
ext_compile_defines = CDEFS[:]
if build_extension.compiler == 'mingw32':
ext_compile_flags.append('-Wno-format')
......@@ -1066,6 +1068,7 @@ class CythonCompileTestCase(unittest.TestCase):
module,
sources=self.source_files(workdir, module, related_files),
extra_compile_args=ext_compile_flags,
define_macros=ext_compile_defines,
**extra_extension_args
)
......@@ -2306,7 +2309,7 @@ def runtests(options, cmd_args, coverage=None):
build_in_temp=True,
pyxbuild_dir=os.path.join(WORKDIR, "support"))
sys.path.insert(0, os.path.split(libpath)[0])
CFLAGS.append("-DCYTHON_REFNANNY=1")
CDEFS.append(('CYTHON_REFNANNY', '1'))
if xml_output_dir and options.fork:
# doesn't currently work together
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment