summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
Commit message (Collapse)AuthorAgeFilesLines
* Bump minimum supported Python from 3.4 to 3.5.python35Jussi Pakkanen2018-01-041-2/+2
|
* Added init command that creates a sample exe project.Jussi Pakkanen2017-12-311-1/+3
|
* Remember which Visual Studio backend was auto-detectedGabrĂ­el ArthĂșr PĂ©tursson2017-12-301-0/+1
| | | | | | | This fixes the REGEN build target since VSINSTALLDIR does not get set by Visual Studio when building targets. Fixes #2848.
* mesonmain: Remove useless ternaryDylan Baker2017-12-191-1/+1
| | | | This ternary checks the value of a bool, and returns the same value.
* Don't print traceback when options are invalidDylan Baker2017-11-281-1/+5
| | | | | | | | Currently passing a bad combo or array option, providing a non-boolean to a bool arg, or a host of other things can cause an traceback from a MesonException, don't do that. Fixes #2683
* Make the full test suite runnable with an external command.Jussi Pakkanen2017-11-201-42/+44
|
* Replaced sys.executable use with the mesonlib equivalent.Jussi Pakkanen2017-11-201-1/+1
|
* Add command to run Python scripts with the current interpreter.Jussi Pakkanen2017-11-201-0/+6
|
* Merge pull request #2511 from jon-turney/prefix-dependent-defaultsJussi Pakkanen2017-11-131-1/+6
|\ | | | | Make sysconfdir, localstatedir and sharedstatedir defaults depend on prefix
| * Make sysconfdir, localstatedir and sharedstatedir defaults depend on prefixJon Turney2017-10-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Rather than requiring a bit of boilerplate in every meson.build, which is only documented in a comment in mesoncore.py, use sensible defaults for sysconfdir, localstatedir and sharedstatedir depending on the prefix. Fixes #1637 v2: For clarity, give get_builtin_option_default() a noneIfSuppress argument, rather than overloading prefix '' and None with special meanings.
* | Print correct command in help messageEric Engestrom2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | Taking mconf for instance: before: $ meson configure --help usage: meson [-h] [-D SETS] [--clearcache] [directory [directory ...]] after: $ meson configure --help usage: meson configure [-h] [-D SETS] [--clearcache] [directory [directory ...]]
* | Dump coredata earlier.Elliott Sales de Andrade2017-11-061-16/+12
|/ | | | | | | | | Unfortunately, `time.time` and file timestamps are not guaranteed to be in sync and due to various kernel caches may be different enough to cause rebuilds to fail [1]. This was masked by older ninja versions that could not read sub-second timestamps. [1] https://travis-ci.org/mesonbuild/meson/jobs/296797872
* flake8: Perform suggested whitespace/formatting changesLuke Shumaker2017-09-211-5/+5
| | | | | This only touches newlines, spaces, and (occaisionally) commas. Anything else is left for another commit.
* logging: Print location of log file on errorNirbheek Chauhan2017-09-141-1/+5
| | | | | | Similar to configure Closes https://github.com/mesonbuild/meson/issues/2316
* Update message for already configured builddirChet Gurevitch2017-09-121-7/+6
|
* wrap-mode: Make the error output more usefulNirbheek Chauhan2017-09-071-1/+9
| | | | | | Now it errors out while displaying the possible options See: https://bugs.python.org/issue25061 for native support
* Merge pull request #2163 from chetgurevitch/masterJussi Pakkanen2017-08-201-4/+5
|\ | | | | Don't error if build directory is already configured and update instructions
| * Tell users about ninja rebuild and meson configureChet Gurevitch2017-08-181-2/+3
| |
| * Don't error if build directory is already configuredChet Gurevitch2017-08-181-3/+3
| |
* | Ensure log file gets closed.Jussi Pakkanen2017-08-181-0/+6
|/
* Print deprecation warnings on old style commands.Jussi Pakkanen2017-08-021-3/+6
|
* Add command multiplexer to main Meson invoker.Jussi Pakkanen2017-08-021-2/+24
|
* Run postconf scripts after dumping coredata.Elliott Sales de Andrade2017-07-151-5/+11
| | | | | | | MESONINTROSPECT is set when running postconf scripts, which implies that introspection is possible. But it isn't really possible because coredata hasn't been written yet. We also still need to make sure to delete coredata if any postconf scripts fail.
* Add an env var to force meson to print a backtraceNirbheek Chauhan2017-06-091-0/+4
| | | | | | | This is really useful when debugging test failures. Without a stack trace, you have to grep the source code for the error message. Also set this in run_tests.py.
* Whitespace tweaks to reduce Flake8 warningsAlistair Thomas2017-05-291-1/+1
|
* Clarify multiple uses of -D. Closes #1836.Jussi Pakkanen2017-05-261-2/+2
|
* Moved coverage commands to a standalone script.Jussi Pakkanen2017-05-131-0/+3
|
* Created a dist target. Closes #877.Jussi Pakkanen2017-05-111-0/+3
|
* Merge pull request #1587 from mesonbuild/tingping/msgfmt-datadirJussi Pakkanen2017-05-031-0/+3
|\ | | | | i18n: Improve data_dirs support
| * i18n: Add data_dirs kwarg to merge_file()Patrick Griffis2017-04-291-0/+3
| | | | | | | | | | | | For parity with gettext() Fixes #1565
* | Expand input paths so they do not contain symlinks.Jussi Pakkanen2017-05-021-2/+2
| |
* | Don't use len() to test emptiness vs not emptinessDylan Baker2017-05-021-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson has a common pattern of using 'if len(foo) == 0:' or 'if len(foo) != 0:', however, this is a common anti-pattern in python. Instead tests for emptiness/non-emptiness should be done with a simple 'if foo:' or 'if not foo:' Consider the following: >>> import timeit >>> timeit.timeit('if len([]) == 0: pass') 0.10730923599840025 >>> timeit.timeit('if not []: pass') 0.030033907998586074 >>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass') 0.1154778649979562 >>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass") 0.08259823200205574 >>> timeit.timeit('if len("") == 0: pass') 0.089759664999292 >>> timeit.timeit('if not "": pass') 0.02340641999762738 >>> timeit.timeit('if len("foo") == 0: pass') 0.08848102600313723 >>> timeit.timeit('if not "foo": pass') 0.04032287199879647 And for the one additional case of 'if len(foo.strip()) == 0', which can be replaced with 'if not foo.isspace()' >>> timeit.timeit('if len(" ".strip()) == 0: pass') 0.15294511600222904 >>> timeit.timeit('if " ".isspace(): pass') 0.09413968399894657 >>> timeit.timeit('if len(" abc".strip()) == 0: pass') 0.2023209120015963 >>> timeit.timeit('if " abc".isspace(): pass') 0.09571301700270851 In other words, it's always a win to not use len(), when you don't actually want to check the length.
* Make it possible to only do unity builds on subprojects.Jussi Pakkanen2017-04-151-1/+1
|
* Merge pull request #1516 from centricular/git-submodule-subprojectsJussi Pakkanen2017-03-251-0/+5
|\ | | | | Add support for using git submodules as subprojects
| * wrap: Implement special wrap modes for use by packagersNirbheek Chauhan2017-03-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | add 'vs' backend that automatically chooses between the vs backendsNicolas Schneider2017-03-231-0/+4
| | | | | | | | | | | | | | | | | | For newer VS versions, we can simply rely on 'VisualStudioVersion' being set in the environment. For VS2010, we fall back to check 'VSINSTALLDIR' for the version string. If the backend can not be auto detected, we raise an exception to make the user choose an explicit backend. We also print the detected backend to the meson log.
* | add vs2017 backendNicolas Schneider2017-03-221-0/+3
|/ | | | | | VS2017 requires the 'WindowsTargetPlatformVersion' property to be set. We gather the version to use from the environment variable 'WindowsSDKVersion' that will be set by the VS developer command prompt.
* Force installation dir options to be inside prefixNirbheek Chauhan2017-01-231-9/+0
| | | | | | | | | | | | | | | | | | | With the exception of things like sysconfdir (/etc), every other installation directory option must be inside the prefix. Also move the prefix checks to coredata.py since prefix can also be set from inside project() with default_options and via mesonconf. Earlier you could set prefix to a relative path that way. This also allows us to return consistent values for get_option('xxxdir') regardless of whether relative paths are passed or absolute paths are passed while setting options on the command-line, via mesonconf, or via default_options in project(). Now the returned path will *always* be relative to the prefix. Includes a unit test for this, and a failing test. Closes #1299
* cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-4/+4
|
* style: fix E202 violationsIgor Gnatenko2017-01-021-1/+1
| | | | | | E202: whitespace before ']' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E201 violationsIgor Gnatenko2017-01-021-1/+1
| | | | | | E201: whitespace after '[' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Add simple uninstall target. Closes #753.Jussi Pakkanen2016-12-311-0/+3
|
* Use a script to clean-up custom-target output dirsNirbheek Chauhan2016-12-191-0/+3
| | | | | | | | | The script will manually delete all custom_target outputs that are directories instead of files. This is needed because on platforms other than Windows, Ninja only deletes directories while cleaning if they are empty. Closes #1220
* add support for $sharedstatedirIgor Gnatenko2016-12-181-0/+1
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* add support for $infodirIgor Gnatenko2016-12-181-0/+1
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* add support for $sbindirIgor Gnatenko2016-12-181-0/+1
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* add builtin support for localstatedirIgor Gnatenko2016-12-061-0/+1
| | | | | | Reported-by: Richard Hughes <richard@hughsie.com> Closes: https://github.com/mesonbuild/meson/issues/1142 Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
* Tell users about mesonconf if they try to run Meson on an existing build dir.Jussi Pakkanen2016-12-031-1/+3
|
* Don't show tracebacks for MesonException in helper scriptsSam Thursfield2016-11-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hit an issue when building gtk-doc documentation. The issue is my fault, but the error output from Meson makes it look like an internal error: [0/1] 'Running external command libtracker-sparql-doc.' Building documentation for libtracker-sparql Traceback (most recent call last): File "/home/sam/meson/meson.py", line 26, in <module> sys.exit(main()) File "/home/sam/meson/meson.py", line 23, in main return mesonmain.run(launcher, sys.argv[1:]) File "/home/sam/meson/mesonbuild/mesonmain.py", line 249, in run sys.exit(run_script_command(args[1:])) File "/home/sam/meson/mesonbuild/mesonmain.py", line 239, in run_script_command return cmdfunc(cmdargs) File "/home/sam/meson/mesonbuild/scripts/gtkdochelper.py", line 183, in run options.ignore_headers.split('@@') if options.ignore_headers else []) File "/home/sam/meson/mesonbuild/scripts/gtkdochelper.py", line 133, in build_gtkdoc gtkdoc_run_check(mkhtml_cmd, os.path.join(abs_out, 'html')) File "/home/sam/meson/mesonbuild/scripts/gtkdochelper.py", line 55, in gtkdoc_run_check raise MesonException('\n'.join(err_msg)) mesonbuild.mesonlib.MesonException: 'gtkdoc-mkhtml' failed with status 6 warning: failed to load external entity "../overview.sgml" ../libtracker-sparql-docs.sgml:20: element include: XInclude error : could not load ../overview.sgml, and no fallback was found warning: failed to load external entity "../examples.sgml" ../libtracker-sparql-docs.sgml:41: element include: XInclude error : could not load ../examples.sgml, and no fallback was found FAILED: libtracker-sparql-doc After this patch, the output is much clearer: [0/1] 'Running external command libtracker-sparql-doc.' Building documentation for libtracker-sparql Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 6 warning: failed to load external entity "../overview.sgml" ../libtracker-sparql-docs.sgml:20: element include: XInclude error : could not load ../overview.sgml, and no fallback was found warning: failed to load external entity "../examples.sgml" ../libtracker-sparql-docs.sgml:41: element include: XInclude error : could not load ../examples.sgml, and no fallback was found Note the actual errors from xsltproc are swallowed by gtkdoc-mkhtml 1.25.1, they're only displayed in the example above because I made a patch: <https://bugzilla.gnome.org/show_bug.cgi?id=774812>
* All testing is now in mesontest.py, which simplifies a lot of stuff.Jussi Pakkanen2016-11-181-6/+0
|