Commit Graph

36 Commits

Author SHA1 Message Date
Dylan Baker 091452f8cd modules/python3: allow specifying in the native file 2018-11-14 15:57:37 -08:00
Dylan Baker f159735c3b modules/windows: Allow getting windres from native file 2018-11-14 15:57:37 -08:00
Dylan Baker 95403cb615 replace ExternalProgram.from_cross_info with from_bin_list
This more generic method will also be used to check a config file for
binary information.
2018-11-14 15:57:37 -08:00
Jon Turney d35034b21b
Use 'rc' resource compiler with clang-cl toolchain
The LLVM toolchain doesn't come with a Windows resource compiler at
the moment. Use 'rc' from the Windows SDK.
2018-11-04 15:42:06 +00:00
Jon Turney d0acada1d5
Probe Windows resource compiler type
Determine the type of the Windows resource compiler by looking at its
output, not its name.

Also log the name and version of the resource compiler we are using.
2018-10-02 13:19:08 +01:00
Jon Turney d769de316d
Factor out windows resource compiler determination
Factor out determination of the windows resource compiler as
_find_resource_compiler().  Cache the result, so the work is only done once.
2018-10-01 21:30:45 +01:00
Jon Turney 654101414c Improve windows resource compiler executable selection
Always honour any windres setting in cross-file (we can't be compiling with
msvc, but this should apply when cross-compiling using gcc or clang)

Always honour WINDRES environment variable

Otherwise look for the resource compiler which is part of the same toolset
as the C or C++ compiler.

Add some commentary on why the conventions for compiled resource file
extensions differ between RC and windres

Also don't try to report non-existent path when we couldn't find the
resource compiler.
2018-09-10 21:03:41 +03:00
Jon Turney e0e980e064 Remove some spurious calls to the format() function
Remove some spurious calls to the format() function, left by mistake after
c2f37853
2018-08-27 00:56:14 +03:00
Jon Turney c2f3785383
Use unique output for windows.compile_resources()
Use a unique output filename for windows.compile_resources() even when input
basename is not unique.
2018-08-16 20:34:44 +01:00
Nirbheek Chauhan ec29f19c12 Add a helper for fetching of binaries from cross files
A number of cases have to be taken care of while doing this, so
refactor it into a helper on ExternalProgram and use it everywhere.

1. Command is a list of len > 1, use it as-is
2. Command is a list of len == 1 (or a string), use as a string
3. If command is an absolute path, use it as-is
4. If command is not an absolute path, search for it
2018-07-01 13:59:48 +00:00
Jon Turney 7c4b8591b0 Make depends: of windows.compile_resources() include-able
Add the output directories for any custom target in depends: to the resource
compiler include path
2018-06-18 10:52:21 +00:00
Jon Turney c0f59399e4 Add a depends: keyword to windows.compile_resources()
Expose depends: from the custom_target this creates.
2018-06-18 10:52:21 +00:00
Jon Turney 884f38fe1b Use a unique name for windows resource compilation custom target 2018-06-07 18:11:49 +01:00
Nirbheek Chauhan 9b314c9c24 FeatureNew: add two features that were just merged 2018-06-05 15:57:57 +00:00
Jon Turney 7a15214a69 Have the windows.resource_compiler() preprocesor write a depfile
When using binutils's windres, we can instruct it to invoke the preprocessor
in such a way that it writes a depfile, so that dependencies on #included
files are automatically tracked.

Not implemented for MSVC tools, so skip testing it in that case.
2018-06-03 21:06:23 +00:00
Jon Turney aa27f7cec9 Add a depend_files: keyword to windows.compile_resources()
Expose depend_files: from the custom_target this creates.

This is the change suggested in #2815, with tests and documentation added.

Fixes #2789 (duplicate #2830)
2018-06-01 20:21:09 +00:00
Xavier Claessens b3f74b9c3a Windows: Fix exception when windres is not found
If rescomp is not found its command is None and that make meson print
backtrace instead of displaying the error message.
2018-05-21 23:29:06 +03:00
Jussi Pakkanen 998892ed29 Updated all modules to work with the new API. 2018-04-15 13:32:38 +05:30
Andrei Alexeyev f8bd1c5ff2
windows.compile_resources: fix compiling multiple resources within one project 2018-01-12 23:36:48 +02:00
Andrei Alexeyev ef7cb9f280
[windows] make compile_resources use custom targets instead of generators 2018-01-12 23:36:48 +02:00
Luke Shumaker 4dbbb4884c flake8: Clean up complained-about unused imports
This also adds a "# noqa: F401" comment on an unused "import lzma",
which we are using it in a try/except block that is being used to
check if the lzma module is importable; of course it is unused.

v2: This turned out to be a little tricky.

    mesonbuild/modules/__init__.py had the "unused" import:

        from ..interpreterbase import permittedKwargs, noKwargs

    However, that meant that the various modules could do things like:

        from . import noKwargs # "." is "mesonbuild.modules"

    Which breaks when you remove __init__.py's "unused" import.  I
    could have tagged that import with "# noqa: F401", but instead I
    chose to have each of the module import directly from
    "..interpreterbase" instead of ".".
2017-09-21 13:41:03 -04:00
Alexis Jeandet bf64cf569b Gnome, pkgconfig, Qt4, Qt5 and windows modules slightly refactored.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:21:22 +02:00
Jussi Pakkanen 3262be23dc Fixed issues raised in review. 2017-06-26 23:29:42 +03:00
Jussi Pakkanen 4a37baf3c5 Fixed the remaining modules. 2017-06-26 21:10:27 +03:00
Dylan Baker af820b77d8 Allow specifying windres binary in cross files
When cross compiling with mingw it's problematic to assume that there is
a binary called windres, and having to set it via an environment
variable seems wrong when there is a handy cross-file for just such a
situation.

This patch allows setting windres in the [binaries] section of the cross
file. If the build is a cross build, then the windows module will check
for windres being set in the cross file before checking the WINDRES
environment variable or looking for a windres binary.
2017-04-08 21:08:06 +03:00
Nirbheek Chauhan 976c9abcd0 modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@
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
2017-03-28 14:49:32 +05:30
Jussi Pakkanen fbabe8ad85 There are two different kinds of extensions: modules that create new
objects directly and snippets that just call into interpreter methods.
2017-01-09 21:11:48 +02:00
Jussi Pakkanen 340781c515 Fix Gnome module. 2017-01-09 20:04:52 +02:00
Jussi Pakkanen b55235dfbd Fix space before :. 2016-12-31 16:28:15 +02:00
Elliott Sales de Andrade 157549fe72 Add include_directories to windows.compile_resources. 2016-12-28 17:19:46 -05:00
Elliott Sales de Andrade 18c38df875 Add Generator.process_files to reduce code duplication. 2016-12-22 17:08:32 +02:00
Nirbheek Chauhan 7b3d00fee4 Use dict for self.build.compilers instead of list
Everywhere we use this object, we end up iterating over it and comparing
compiler.get_language() with something. Using a dict is the obvious
choice and simplifies a lot of code.
2016-12-13 09:20:34 +05:30
Jussi Pakkanen 4a92b78e6e A few error message fixes. 2016-07-28 20:45:38 +03:00
Nirbheek Chauhan 201f2aebed Also read WINDRES envvar to find windres (#645)
This is, of course, only used when building with MinGW
2016-07-18 23:58:48 +03:00
Hemmo Nieminen 336904b553 Move MesonException from coredata to mesonlib. 2016-04-01 00:52:45 +03:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00