diff --git a/tools/distrib/gen_compilation_database.py b/tools/distrib/gen_compilation_database.py index 5cda6d69e35..f2c93ade71c 100755 --- a/tools/distrib/gen_compilation_database.py +++ b/tools/distrib/gen_compilation_database.py @@ -90,6 +90,9 @@ def modifyCompileCommand(target, args): options = options.replace("-std=c++0x ", "") options = options.replace("-std=c++14 ", "") + # Add -DNDEBUG so that editors show the correct size information for structs. + options += " -DNDEBUG" + if args.vscode: # Visual Studio Code doesn't seem to like "-iquote". Replace it with # old-style "-I". diff --git a/tools/dockerfile/grpc_iwyu/iwyu.sh b/tools/dockerfile/grpc_iwyu/iwyu.sh index 0a092a90869..20f2a77e2f1 100755 --- a/tools/dockerfile/grpc_iwyu/iwyu.sh +++ b/tools/dockerfile/grpc_iwyu/iwyu.sh @@ -37,7 +37,10 @@ cd ${IWYU_ROOT} sed -i 's,^#!/usr/bin/env python,#!/usr/bin/env python3,g' ${IWYU_ROOT}/iwyu/iwyu_tool.py sed -i 's,^#!/usr/bin/env python,#!/usr/bin/env python3,g' ${IWYU_ROOT}/iwyu/fix_includes.py -cat compile_commands.json | sed "s,\"file\": \",\"file\": \"${IWYU_ROOT}/,g" > compile_commands_for_iwyu.json +cat compile_commands.json \ + | sed "s/ -DNDEBUG//g" \ + | sed "s,\"file\": \",\"file\": \"${IWYU_ROOT}/,g" \ + > compile_commands_for_iwyu.json export ENABLED_MODULES=' src/core/ext