summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #1628 from ximion/dfixJussi Pakkanen2017-04-171-1/+1
|\ | | | | d: Fix linking shared libraries with DMD
| * d: Fix linking shared libraries with DMDMatthias Klumpp2017-04-151-1/+1
| |
* | Make it possible to only do unity builds on subprojects.Jussi Pakkanen2017-04-151-1/+8
|/
* Merge pull request #1548 from ssssam/sam/stable-orderingJussi Pakkanen2017-04-131-1/+2
|\ | | | | Stable ordering of some commandlines generated by 'gnome' module
| * Ensure rules in the generated build.ninja file are in a stable orderSam Thursfield2017-04-031-1/+2
| | | | | | | | | | | | | | | | | | | | Previously, two functionally identical builds could produce different build.ninja files. The ordering of the rules themselves doesn't affect behaviour, but unnecessary changes in commandline arguments can cause spurious rebuilds and if the ordering of the overall file is stable than it's easy to use `diff` to compare different build.ninja files and spot the differences in ordering that are triggering the unnecessary rebuilds.
* | vs: Fix depend_files support in custom targetsNirbheek Chauhan2017-04-101-0/+16
| | | | | | | | | | This was totally broken and we didn't notice because we had no tests for it at all.
* | Merge pull request #1469 from centricular/install-secondary-outputsJussi Pakkanen2017-04-091-2/+2
|\ \ | | | | | | Support multiple install dirs for built/custom targets
| * | Support multiple install dirs for built/custom targetsNirbheek Chauhan2017-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now pass a list of strings to the install_dir: kwarg to build_target and custom_target. Custom Targets: =============== Allows you to specify the installation directory for each corresponding output. For example: custom_target('different-install-dirs', output : ['first.file', 'second.file'], ... install : true, install_dir : ['somedir', 'otherdir]) This would install first.file to somedir and second.file to otherdir. If only one install_dir is provided, all outputs are installed there (same behaviour as before). To only install some outputs, pass `false` for the outputs that you don't want installed. For example: custom_target('only-install-second', output : ['first.file', 'second.file'], ... install : true, install_dir : [false, 'otherdir]) This would install second.file to otherdir and not install first.file. Build Targets: ============== With build_target() (which includes executable(), library(), etc), usually there is only one primary output. However some types of targets have multiple outputs. For example, while generating Vala libraries, valac also generates a header and a .vapi file both of which often need to be installed. This allows you to specify installation directories for those too. # This will only install the library (same as before) shared_library('somevalalib', 'somesource.vala', ... install : true) # This will install the library, the header, and the vapi into the # respective directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : ['libdir', 'incdir', 'vapidir']) # This will install the library into the default libdir and # everything else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [true, 'incdir', 'vapidir']) # This will NOT install the library, and will install everything # else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [false, 'incdir', 'vapidir']) true/false can also be used for secondary outputs in the same way. Valac can also generate a GIR file for libraries when the `vala_gir:` keyword argument is passed to library(). In that case, `install_dir:` must be given a list with four elements, one for each output. Includes tests for all these. Closes https://github.com/mesonbuild/meson/issues/705 Closes https://github.com/mesonbuild/meson/issues/891 Closes https://github.com/mesonbuild/meson/issues/892 Closes https://github.com/mesonbuild/meson/issues/1178 Closes https://github.com/mesonbuild/meson/issues/1193
* | | Merge pull request #1518 from centricular/mesonintrospect-evarJussi Pakkanen2017-04-081-3/+5
|\ \ \ | | | | | | | | Export MESONINTROSPECT to postconf/install/run_command scripts
| * | | Export MESONINTROSPECT to postconf/install/run_command scriptsNirbheek Chauhan2017-03-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Points to the `mesonintrospect.py` script corresponding to the currently-running version of Meson. Includes a test for all three methods of running scripts/commands. Closes https://github.com/mesonbuild/meson/issues/1385
* | | | Use extra_paths on CygwinJon Turney2017-04-061-2/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | Cygwin executables are still loaded by the Windows PE loader, so PATH needs to include any extra directories where required DLLs can be found. Cygwin uses a unix style ':'-separated PATH. os.pathsep is used correctly on extra_paths in meson_exe.py, but not in mesontest.py
* | | Review fixes.Jussi Pakkanen2017-04-021-1/+1
| | |
* | | Proxy object for overriding options transparently.Jussi Pakkanen2017-04-021-1/+21
| | |
* | | Use get_option_for_target for builtins where sensible.Jussi Pakkanen2017-04-021-8/+8
| | |
* | | Use relative object file name for unity files everywhere.Jussi Pakkanen2017-04-021-7/+9
| | |
* | | Create unity files with the VS backend.Jussi Pakkanen2017-04-021-3/+11
| |/ |/|
* | modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@Nirbheek Chauhan2017-03-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | First step in fixing https://github.com/mesonbuild/meson/issues/1419 Also works around an issue in the MinGW windres.exe that causes it to fail if any of the arguments passed to it contain a space. There seems to be no way to quote or escape the spaces in the path to make windres parse the path correctly, so we just warn about it instead. https://sourceware.org/bugzilla/show_bug.cgi?id=4933 https://github.com/mesonbuild/meson/pull/1346
* | Preserve the order of internal deps in a targetNirbheek Chauhan2017-03-231-3/+5
|/ | | | | | | | We were adding them to the CompilerArgs instance in the order in which they are specified, which is wrong because later dependencies would override previous ones. Add them in the reverse order instead. Closes https://github.com/mesonbuild/meson/issues/1495
* Nuke dead code which was used for installing PDB filesNirbheek Chauhan2017-03-031-6/+0
| | | | | | | We check for the existence of PDB files in the install script, so we don't need to do all this mucking about here. That's more robust too because we don't need to parse build arguments in buildtype=plain and decide if the PDB file would be generated.
* Use cross stripper when cross compiling and allow overriding native strip ↵Jussi Pakkanen2017-02-271-1/+2
| | | | executable. Closes #1414.
* Merge pull request #1403 from centricular/compile_resourcesJussi Pakkanen2017-02-201-43/+13
|\ | | | | Make configure_file() great again
| * Rewrite custom_target template string substitutionNirbheek Chauhan2017-02-201-43/+13
| | | | | | | | | | | | | | | | Factor it out into a function in mesonlib.py. This will allow us to reuse it for generators and for configure_file(). The latter doesn't implement this at all right now. Also includes unit tests.
* | find_program: Fix implementation of .path()Nirbheek Chauhan2017-02-191-7/+7
|/ | | | | | | | And actually test that prog.path() works. The earlier test was just running the command without checking if it succeeded. Also make everything use prog.get_command() or get_path() instead of accessing the internal member prog.fullpath directly.
* Merge pull request #1335 from tp-m/test-custom-target-used-in-test-cmdJussi Pakkanen2017-01-281-0/+23
|\ | | | | tests: check custom target output is created before being used in a t…
| * backends: Add support for build_by_default to vs2010 backendNirbheek Chauhan2017-01-281-0/+23
| | | | | | | | | | | | Always generate the vcxproj file, but only add it to the build configuration if it's either supposed to be built by default, or is a dependency of another target that is built by default.
* | Use CompilerArgs for generation of link commandsNirbheek Chauhan2017-01-281-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, now the linker options are added from various sources in the same order as compiler arguments for compile commands. As a result, all libraries and library paths from external and internal sources are added after all the linker options have been added. As a result option_link_args() are added when libraries are added to the list since currently the only thing they add are the libraries specific in cpp_winlibs/c_winlibs. This fixes an issue where compilation with the MinGW toolchain (which uses static libraries for winlibs) would result in undefined symbol errors because the static libraries would be added in the very beginning and hence would not be scanned for symbols. Detailed comments have been added that explain where each option is coming from and why it's been added at that specific point. More improvements are necessary here because we currently still unnecessarily repeat libraries from dependencies over and over, which is a major problem in gst-build because inter-subproject dependencies cause linker command-lines to almost exceed the argument list length limit imposed by the kernel. It is also causing us to unnecessarily add static libraries which have already been linked into a shared library. See: self.build_target_link_arguments()
* | Use CompilerArgs for generation of compile commandsNirbheek Chauhan2017-01-281-11/+39
| | | | | | | | | | | | | | | | At the same time, also fix the order in which compile arguments are added. Detailed comments have been added concerning the priority and order of the arguments. Also adds a unit test and an integration test for the same.
* | compilers: New class CompilerArgs derived from list()Nirbheek Chauhan2017-01-271-1/+1
|/ | | | | | | | | | | | | | | | | The purpose of this class is to make it possible to sanely generate compiler command-lines by ensuring that new arguments appended or added to a list of arguments properly override previous arguments. For instance: >>> a = CompilerArgs(['-Lfoo', '-DBAR']) >>> a += ['-Lgah', '-DTAZ'] >>> print(a) ['-Lgah', '-Lfoo', '-DBAR', '-DTAZ'] Arguments will be de-duped if it is safe to do so. Currently, this is only done for -I and -L arguments (previous occurances are removed when a new one is added) and arguments that once added cannot be overriden such as -pipe are removed completely.
* Support file perms for install_data and install_subdirNirbheek Chauhan2017-01-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | With the 'install_mode' kwarg, you can now specify the file and directory permissions and the owner and the group to be used while installing. You can pass either: * A single string specifying just the permissions * A list of strings with: - The first argument a string of permissions - The second argument a string specifying the owner or an int specifying the uid - The third argument a string specifying the group or an int specifying the gid Specifying `false` as any of the arguments skips setting that one. The format of the permissions kwarg is the same as the symbolic notation used by ls -l with the first character that specifies 'd', '-', 'c', etc for the file type omitted since that is always obvious from the context. Includes unit tests for the same. Sadly these only run on Linux right now, but we want them to run on all platforms. We do set the mode in the integration tests for all platforms but we don't check if they were actually set correctly.
* cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-6/+6
|
* cleanup: Redundant character escapeMike Sinkovsky2017-01-181-1/+1
|
* Can use targets directly in test arguments.Jussi Pakkanen2017-01-151-1/+9
|
* style: [E303] too many blank lines (2)Mike Sinkovsky2017-01-111-1/+0
|
* style: [E502] the backslash is redundant between bracketsMike Sinkovsky2017-01-111-4/+4
|
* Merge pull request #1263 from centricular/meson_exe_deterministicJussi Pakkanen2017-01-021-3/+8
|\ | | | | serialise_executable: Name the data file deterministically
| * serialise_executable: Name the data file deterministicallyNirbheek Chauhan2016-12-311-3/+8
| | | | | | | | Closes #1062
* | style: fix E124 violationsIgor Gnatenko2017-01-011-2/+2
| | | | | | | | | | | | E124: closing bracket does not match visual indentation Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | style: fix E225 violationsIgor Gnatenko2017-01-011-1/+1
|/ | | | | | E225: missing whitespace around operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix space before :.Jussi Pakkanen2016-12-311-2/+2
|
* Do not automatically set warning flags if buildtype is 'plain'Matthias Klumpp2016-12-231-1/+1
|
* ldc: Protect linker flags from deduplicationMatthias Klumpp2016-12-211-1/+1
| | | | | This is the better way to pass arguments through to the linker when compiling D code with LDC.
* Merge pull request #1233 from mesonbuild/wip/ignatenko/code-styleJussi Pakkanen2016-12-211-3/+1
|\ | | | | Trivial cleanups in code
| * tree-wide: remove blank lines at EOFIgor Gnatenko2016-12-191-1/+0
| | | | | | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
| * tree-wide: remove trailing whitespacesIgor Gnatenko2016-12-191-2/+2
| | | | | | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
| * tree-wide: remove unused variablesIgor Gnatenko2016-12-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./mesonbuild/scripts/regen_checker.py:35:5: F841 local variable 'scriptdir' is assigned to but never used scriptdir = os.path.split(__file__)[0] ^ ./mesonbuild/scripts/yelphelper.py:84:13: F841 local variable 'symfile' is assigned to but never used symfile = os.path.join(install_dir, m) ^ ./mesonbuild/backend/backends.py:164:13: F841 local variable 'lang' is assigned to but never used lang = comp.get_language() ^ ./mesonbuild/backend/ninjabackend.py:1286:9: F841 local variable 'scriptdir' is assigned to but never used scriptdir = self.environment.get_script_dir() ^ ./mesonbuild/backend/vs2010backend.py:736:9: F841 local variable 'additional_options_set' is assigned to but never used additional_options_set = True ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | Merge pull request #1227 from centricular/ninja-clean-recursive-dir-deleteJussi Pakkanen2016-12-201-0/+9
|\ \ | | | | | | run_project_tests.py: Also do ninja clean on tests
| * | Use a script to clean-up custom-target output dirsNirbheek Chauhan2016-12-191-0/+9
| |/ | | | | | | | | | | | | | | | | 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
* | Cache the scripts used for postconf and install phasesNirbheek Chauhan2016-12-201-1/+1
|/ | | | | | | | | | | Cache the absolute dir that the script is searched in and the name of the script. These are the only two things that change. Update the test to test for both #1235 and the case when a script of the same name is in a different directory (which also covers the subproject case). Closes #1235
* fix some of pylint's undefined-variableIgor Gnatenko2016-12-191-0/+1
| | | | | | | | | | | | | | | | | ************* Module mesonbuild.modules.rpm E:106,29: Unsupported format character '{' (0x7b) at index 16 (bad-format-character) ************* Module mesonbuild.modules E: 12,14: Undefined variable 'MesonException' (undefined-variable) ************* Module mesonbuild.modules.gnome E:699,69: Undefined variable 'sargs' (undefined-variable) ************* Module mesonbuild.wrap.wrap E:103,25: Undefined variable 'checkoutdir' (undefined-variable) ************* Module mesonbuild.backend.backends E: 83,16: Undefined variable 'mlog' (undefined-variable) ************* Module mesonbuild.backend.ninjabackend E:254,105: Undefined variable 't' (undefined-variable) Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* gnome.mkenums: Use absolute paths for all commandline argsNirbheek Chauhan2016-12-151-9/+10
| | | | | | Closes #973 test cases/vala/8 generated sources/ tests this.