From e3795eb07ed21730776a37c4a90142a280ae3113 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Apr 2018 10:33:10 +0530 Subject: [PATCH] Dont add CPPFLAGS from the python build They contain include paths specific to the python build such as -I. that are not appropriate for building kitty. Also move cppflags in front of cflags when invoking the compiler. --- setup.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 9e4b99c21..09c25d072 100755 --- a/setup.py +++ b/setup.py @@ -173,9 +173,7 @@ def init_env( ('' if debug else 'N'), ) ) - cppflags = shlex.split(cppflags) + shlex.split( - sysconfig.get_config_var('CPPFLAGS') - ) + cppflags = shlex.split(cppflags) cflags = os.environ.get( 'OVERRIDE_CFLAGS', ( '-Wextra -Wno-missing-field-initializers -Wall -std=c99' @@ -359,13 +357,13 @@ def compile_c_extension(kenv, module, incremental, compilation_database, all_key for original_src, dest in zip(sources, objects): src = original_src - cppflgs = kenv.cppflags[:] + cppflags = kenv.cppflags[:] is_special = src in SPECIAL_SOURCES if is_special: src, defines = SPECIAL_SOURCES[src] - cppflgs.extend(map(define, defines)) + cppflags.extend(map(define, defines)) - cmd = [kenv.cc, '-MMD'] + kenv.cflags + cppflgs + cmd = [kenv.cc, '-MMD'] + cppflags + kenv.cflags key = original_src, os.path.basename(dest) all_keys.add(key) cmd_changed = compilation_database.get(key, [])[:-4] != cmd