aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-03-25 06:32:26 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-03-25 06:57:30 +0530
commitd5975cc683f5c03a2060ee28bb467732909cfb97 (patch)
tree30d218f94a2fa94eadfd6326ceeb042becb0c592 /mesonbuild/mesonmain.py
parenta60d688973e8903015f6e4b157332c5c98562f55 (diff)
downloadmeson-d5975cc683f5c03a2060ee28bb467732909cfb97.zip
meson-d5975cc683f5c03a2060ee28bb467732909cfb97.tar.gz
meson-d5975cc683f5c03a2060ee28bb467732909cfb97.tar.bz2
wrap: Implement special wrap modes for use by packagers
Special wrap modes: nofallback: Don't download wraps for dependency() fallbacks nodownload: Don't download wraps for all subproject() calls Subprojects are used for two purposes: 1. To download and build dependencies by using .wrap files if they are not provided by the system. This is usually expressed via dependency(..., fallback: ...). 2. To download and build 'copylibs' which are meant to be used by copying into your project. This is always done with an explicit subproject() call. --wrap-mode=nofallback will never do (1) --wrap-mode=nodownload will do neither (1) nor (2) If you are building from a release tarball, you should be able to safely use 'nodownload' since upstream is expected to ship all required sources with the tarball. If you are building from a git repository, you will want to use 'nofallback' so that any 'copylib' wraps will be download as subprojects. Note that these options do not affect subprojects that are git submodules since those are only usable in git repositories, and you almost always want to download them.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 031486c..a22700b 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -20,6 +20,7 @@ from . import build
import platform
from . import mlog, coredata
from .mesonlib import MesonException
+from .wrap import WrapMode
parser = argparse.ArgumentParser()
@@ -67,6 +68,10 @@ parser.add_argument('-D', action='append', dest='projectoptions', default=[],
help='Set project options.')
parser.add_argument('-v', '--version', action='version',
version=coredata.version)
+ # See the mesonlib.WrapMode enum for documentation
+parser.add_argument('--wrap-mode', default=WrapMode.default,
+ type=lambda t: getattr(WrapMode, t), choices=WrapMode,
+ help='Special wrap mode to use')
parser.add_argument('directories', nargs='*')
class MesonApp: