diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.py | 7 | ||||
-rwxr-xr-x | scripts/build_plugin.py | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/scripts/build.py b/scripts/build.py index 776914175c..91ccd5bae1 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -109,6 +109,9 @@ def get_arguments(): parser.add_argument('--zip-threads', help='Sets number of threads to use for 7z. Use "+" for turning threads on ' 'without a specific number of threads. This is directly passed to the "-mmt" option of 7z.', default='2') + parser.add_argument('--add-sanitize-flags', help="Sets flags for sanitizer compilation flags used in Debug builds", + action='append', dest='sanitize_flags', default=[] ) + args = parser.parse_args() args.with_debug_info = args.build_type == 'RelWithDebInfo' @@ -185,6 +188,10 @@ def build_qtcreator(args, paths): '-DIDE_REVISION_STR=' + ide_revision[:10], '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id=' + 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) diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index 7ba55ef38d..16a51efed5 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -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', '.'] |