aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/windows.py
AgeCommit message (Collapse)AuthorFilesLines
2020-10-15windows: Avoid target name clash happening in GTK+Xavier Claessens1-1/+3
2020-09-28windows: reduce chance of going over path limit in backend/vsPeter Harris1-4/+5
When building with vs2019 (not ninja), a path length error will be thrown if the path to a resource file is even remotely deep within the tree. This is largely because the target name includes the string "Windows resource for file 'full path'", which is then expanded twice (once for the .vcxproj itself, and once for IntDir) and added to the full path. When combined with the tiny path limits on Windows, it is easy to exceed path limits. This error is largely avoided by the ninja back-end. Unlike the vs back-end, the ninja back-end does not use target.get_id() as part of the project file path, nor does it use target.get_id() as part of get_target_private_dir(). Example error: error MSB4184: The expression "[MSBuild]::NormalizePath( C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete)" cannot be evaluated. Path: C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
2020-09-17Revert "windows: reduce chance of going over path limit in backend/vs"Nirbheek Chauhan1-5/+4
This reverts commit 807f88739ebfa002c9a0b9acd3e24c9610fb02a2.
2020-09-17windows: reduce chance of going over path limit in backend/vsPeter Harris1-4/+5
When building with vs2019 (not ninja), a path length error will be thrown if the path to a resource file is even remotely deep within the tree. This is largely because the target name includes the string "Windows resource for file 'full path'", which is then expanded twice (once for the .vcxproj itself, and once for IntDir) and added to the full path. When combined with the tiny path limits on Windows, it is easy to exceed path limits. This error is largely avoided by the ninja back-end. Unlike the vs back-end, the ninja back-end does not use target.get_id() as part of the project file path, nor does it use target.get_id() as part of get_target_private_dir(). Example error: error MSB4184: The expression "[MSBuild]::NormalizePath( C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete)" cannot be evaluated. Path: C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
2020-07-05Don't make unactionable warnings fatalNirbheek Chauhan1-1/+1
Some warnings are out of the user's control, such as the RCC QT bug, or the GNU windres bug, or our informational warning about auto-disabling of options when -Db_bitcode is enabled. Such warnings should not be fatal when --fatal-meson-warnings is passed because there's no action that the user can take to fix it. The only purpose it serves is to prevent people who use those features from using --fatal-meson-warnings.
2020-03-23Fix legacy env var support with crossJohn Ericson1-1/+1
Fix #3969
2020-03-05Make use of unholderDylan Baker1-4/+2
We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
2019-07-05Fix windres module argument flatteningePirat1-2/+2
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-4/+5
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-05-20Remove compilers from ModuleState objectJon Turney1-1/+1
It doesn't make much sense to have this and not also have cross-compilers (so any use of this is already pretty suspect as probably wrong when cross-compiling). This information is accessible anyhow via environment.coredata.
2019-05-13modules/windows: ICL uses rc, not windresDylan Baker1-1/+1
2019-04-29Fix builtin variable namesDaniel Mensinger1-2/+2
2019-01-02Remove cross_info; cross file is parsed up front and discardedJohn Ericson1-19/+3
2018-11-14modules/python3: allow specifying in the native fileDylan Baker1-3/+2
2018-11-14modules/windows: Allow getting windres from native fileDylan Baker1-0/+8
2018-11-14replace ExternalProgram.from_cross_info with from_bin_listDylan Baker1-2/+2
This more generic method will also be used to check a config file for binary information.
2018-11-04Use 'rc' resource compiler with clang-cl toolchainJon Turney1-1/+1
The LLVM toolchain doesn't come with a Windows resource compiler at the moment. Use 'rc' from the Windows SDK.
2018-10-02Probe Windows resource compiler typeJon Turney1-4/+22
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-01Factor out windows resource compiler determinationJon Turney1-17/+25
Factor out determination of the windows resource compiler as _find_resource_compiler(). Cache the result, so the work is only done once.
2018-09-10Improve windows resource compiler executable selectionJon Turney1-21/+35
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-08-27Remove some spurious calls to the format() functionJon Turney1-3/+3
Remove some spurious calls to the format() function, left by mistake after c2f37853
2018-08-16Use unique output for windows.compile_resources()Jon Turney1-12/+15
Use a unique output filename for windows.compile_resources() even when input basename is not unique.
2018-07-01Add a helper for fetching of binaries from cross filesNirbheek Chauhan1-8/+10
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-06-18Make depends: of windows.compile_resources() include-ableJon Turney1-0/+4
Add the output directories for any custom target in depends: to the resource compiler include path
2018-06-18Add a depends: keyword to windows.compile_resources()Jon Turney1-4/+6
Expose depends: from the custom_target this creates.
2018-06-07Use a unique name for windows resource compilation custom targetJon Turney1-2/+4
2018-06-05FeatureNew: add two features that were just mergedNirbheek Chauhan1-1/+2
2018-06-03Have the windows.resource_compiler() preprocesor write a depfileJon Turney1-0/+5
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-01Add a depend_files: keyword to windows.compile_resources()Jon Turney1-1/+3
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-05-21Windows: Fix exception when windres is not foundXavier Claessens1-1/+1
If rescomp is not found its command is None and that make meson print backtrace instead of displaying the error message.
2018-04-15Updated all modules to work with the new API.Jussi Pakkanen1-2/+2
2018-01-12windows.compile_resources: fix compiling multiple resources within one projectAndrei Alexeyev1-7/+33
2018-01-12[windows] make compile_resources use custom targets instead of generatorsAndrei Alexeyev1-5/+10
2017-09-21flake8: Clean up complained-about unused importsLuke Shumaker1-1/+1
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-18Gnome, pkgconfig, Qt4, Qt5 and windows modules slightly refactored.Alexis Jeandet1-4/+2
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-06-26Fixed issues raised in review.Jussi Pakkanen1-1/+1
2017-06-26Fixed the remaining modules.Jussi Pakkanen1-0/+2
2017-04-08Allow specifying windres binary in cross filesDylan Baker1-3/+11
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-03-28modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@Nirbheek Chauhan1-1/+7
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-01-09There are two different kinds of extensions: modules that create newJussi Pakkanen1-3/+4
objects directly and snippets that just call into interpreter methods.
2017-01-09Fix Gnome module.Jussi Pakkanen1-1/+3
2016-12-31Fix space before :.Jussi Pakkanen1-1/+1
2016-12-28Add include_directories to windows.compile_resources.Elliott Sales de Andrade1-0/+10
2016-12-22Add Generator.process_files to reduce code duplication.Elliott Sales de Andrade1-3/+1
2016-12-13Use dict for self.build.compilers instead of listNirbheek Chauhan1-3/+3
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-07-28A few error message fixes.Jussi Pakkanen1-0/+2
2016-07-18Also read WINDRES envvar to find windres (#645)Nirbheek Chauhan1-1/+4
This is, of course, only used when building with MinGW
2016-04-01Move MesonException from coredata to mesonlib.Hemmo Nieminen1-1/+1
2016-01-16Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen1-0/+47
in the same toplevel dir.