diff options
author | vorfol <39548292+vorfol@users.noreply.github.com> | 2021-04-12 21:45:07 +0500 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2021-04-14 08:13:16 +0200 |
commit | 3ae58fea907a5abbc34f1792242a884c194ada5e (patch) | |
tree | 9c90e549bfe6af0b87985e476ac1ca4db61b665a | |
parent | 2419d61c2c7c9e0c0f08384b2ba4898bad6887ea (diff) | |
download | cython-3ae58fea907a5abbc34f1792242a884c194ada5e.tar.gz |
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
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | runtests.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index 46da36e69..f59252e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ MANIFEST /.idea /*.iml +# Visual Studio Code files +.vscode diff --git a/runtests.py b/runtests.py index 9b923612d..7e76dfea5 100755 --- a/runtests.py +++ b/runtests.py @@ -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 |