summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-12-20 00:00:00 +0000
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-29 12:19:51 +0100
commit3126ad5bc833f9404eab339a86be216f223ac687 (patch)
treeaff053b3e1efbc213cd76b4712c39335ab18ef81 /giscanner
parent094446e58d8de6724c50e93d4c475d604a5f2551 (diff)
downloadgobject-introspection-3126ad5bc833f9404eab339a86be216f223ac687.tar.gz
Test commands executed by unix C compiler.
No functional changes intended. Tests check that: * Compiler is obtained from CC. * cc is used as the default compiler. Currently not true as a Python build time compiler is used as the default. * Preprocessor is obtained from CC when CPP is unspecified by adding -E. * Preprocessor is obtained from CPP. * cpp is used as the default preprocessor. Currently not true as Python build time preprocessor is used as the default. * Shell word splitting rules are used to split CC. * Shell word splitting rules are used to split CPP. * Deprecation warnings are disabled during compilation. * Preprocessing step includes CPPFLAGS. * Compilation step includes both CFLAGS and CPPFLAGS, in that order. * Macros from CFLAGS are defined only once. Currently not true as they are defined twice. * Flags that would retain macros after preprocessing step are filtered out. Currently only partially true as they aren't filtered out from CPPFLAGS. * Preprocessing step includes flag that preserves comments. * Preprocessing step includes current working directory. * Complete preprocessing command doesn't contain anything unexpected. Currently not true as Python build time CPPFLAGS are included as well. * Complete build command doesn't contain anything unexpected. Currently not true as Python build time CFLAGS and CPPFLAGS are included as well.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/ccompiler.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 5db04535..24dcbcbf 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -34,6 +34,10 @@ from distutils.sysconfig import customize_compiler
from . import utils
+# Flags that retain macros in preprocessed output.
+FLAGS_RETAINING_MACROS = ['-g3', '-ggdb3', '-gstabs3', '-gcoff3', '-gxcoff3', '-gvms3']
+
+
class CCompiler(object):
compiler_cmd = ''
@@ -376,6 +380,6 @@ class CCompiler(object):
else:
# We expect the preprocessor to remove macros. If debugging is turned
# up high enough that won't happen, so don't add those flags. Bug #720504
- if option not in ['-g3', '-ggdb3', '-gstabs3', '-gcoff3', '-gxcoff3', '-gvms3']:
+ if option not in FLAGS_RETAINING_MACROS:
other_options.append(option)
return (includes, macros, other_options)