From 7570cb28090f31cc90406bb018aa157ac0f69a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 26 Aug 2018 14:43:06 +0200 Subject: [PATCH] Add release and nobuild args to meson.py --- .appveyor.yml | 2 +- meson.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index aa2fa656..dfc85c5c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -53,7 +53,7 @@ before_build: # Build config build_script: - cmd: if defined QMAKE ( call prepare_r2.bat && call build.bat ) - - cmd: if defined MESON ( python meson.py --dist=%ARTIFACT_PATH% --backend=%BACKEND% --jupyter --webengine ) + - cmd: if defined MESON ( python meson.py --release --dist=%ARTIFACT_PATH% --backend=%BACKEND% --jupyter --webengine ) after_build: - ps: $env:py_version = (python --version).Split()[1] diff --git a/meson.py b/meson.py index 91ff119d..9e3bfd3c 100644 --- a/meson.py +++ b/meson.py @@ -56,13 +56,14 @@ def build(args): defines.append('-Dradare2:r2_datdir=radare2/share') r2_meson_mod.meson(os.path.join(ROOT, 'src'), cutter_builddir, prefix=cutter_builddir, backend=args.backend, - release=True, shared=False, options=defines) - log.info('Building cutter') - if args.backend == 'ninja': - r2_meson_mod.ninja(cutter_builddir) - else: - project = os.path.join(cutter_builddir, 'Cutter.sln') - r2_meson_mod.msbuild(project, '/m') + release=args.release, shared=False, options=defines) + if not args.nobuild: + log.info('Building cutter') + if args.backend == 'ninja': + r2_meson_mod.ninja(cutter_builddir) + else: + project = os.path.join(cutter_builddir, 'Cutter.sln') + r2_meson_mod.msbuild(project, '/m') def main(): set_global_vars() @@ -76,6 +77,10 @@ def main(): help='Enable Jupyter support') parser.add_argument('--webengine', action='store_true', help='Enable QtWebEngine support') + parser.add_argument('--release', action='store_true', + help='Set the build as Release (remove debug info)') + parser.add_argument('--nobuild', action='store_true', + help='Only run meson and do not build.') if os.name == 'nt': parser.add_argument('--dist', help='dist directory') args = parser.parse_args()