Add option to build QtCreator with sanitizer

Fixes: QTCREATORBUG-26318
Change-Id: I44589b5bb39958eda2329b444e4857e8f61823bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Joerg Kreuzberger
2021-10-05 07:40:58 +02:00
committed by Cristian Adam
parent 9e8b838080
commit efdaeaba43
5 changed files with 32 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ def get_arguments():
action='append', dest='config_args', default=[])
parser.add_argument('--with-docs', help='Build and install documentation.',
action='store_true', default=False)
parser.add_argument('--add-sanitize-flags', help="Sets flags for sanitizer compilation flags used in Debug builds",
action='append', dest='sanitize_flags', default=[] )
parser.add_argument('--deploy', help='Installs the "Dependencies" component of the plugin.',
action='store_true', default=False)
parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)',
@@ -110,6 +112,10 @@ def build(args, paths):
with open(os.path.join(paths.result, args.name + '.7z.git_sha'), 'w') as f:
f.write(ide_revision)
if not args.build_type.lower() == 'release' and args.sanitize_flags:
cmake_args += ['-DWITH_SANITIZE=ON',
'-DSANITIZE_FLAGS=' + ",".join(args.sanitize_flags)]
cmake_args += args.config_args
common.check_print_call(cmake_args + [paths.src], paths.build)
build_args = ['cmake', '--build', '.']