Commit Graph

5764 Commits

Author SHA1 Message Date
Xavier Claessens 6eeea9dd54 Compilers: Chain-up to parent class in get_options()
Parent class could have common options for all compilers, and we'll soon
add some.
2018-06-06 20:02:37 +00:00
Chun-wei Fan 3c4c8bf775 environment.py: Properly check platform on MSVC 2008
The 'Platform' envvar may not be set on Visual Studio 2008, at least
when using the SDK 7.0 compilers, so check the 'BUILD_PLAT' envvar so
that we do not mis-detect x64 build environments as x86.
2018-06-06 18:37:29 +00:00
Nirbheek Chauhan f9f3a51243 Revert "really switch to qmake automatically if pkg-config fails"
This reverts commit 0045d95a16.

<jeandet> nirbheek, it seems 0045d95a16 is
really wrong, I've tested on Ubuntu.  While writing this line I was
thinking that you can't have Qt without a working qmake in the path. On
Ubuntu you have that qtchooser stuff which is misleading.
2018-06-06 18:35:59 +00:00
Yudi Matsuzake 4ee07dd165 docs: Fix dictionary syntax [skip ci] 2018-06-06 18:18:23 +00:00
Nirbheek Chauhan 56a7d8b2b3 Warn when Apple bitcode support is enabled and in-use
We have to disable some options, so tell the user about them and point
to the documentation so they can read more about it.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 0565262be3 Add documentation for Builtin options and bitcode
Also add a test that ensures that new base options and compiler options
are always documented.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 3e1a610702 Add a new option for building with Apple bitcode support
Normally, people would just pass -fembed-bitcode in CFLAGS, but this
conflicts with -Wl,-dead_strip_dylibs and -bundle, so we need it as
an option so that those can be quietly disabled.
2018-06-06 07:53:10 +00:00
Nirbheek Chauhan 68001193d3 meson introspect: Fix --installed argument
Traceback (most recent call last):
  File "meson.py", line 29, in <module>
    sys.exit(mesonmain.main())
  File "mesonbuild/mesonmain.py", line 411, in main
    return run(sys.argv[1:], launcher)
  File "mesonbuild/mesonmain.py", line 320, in run
    return mintro.run(remaining_args)
  File "mesonbuild/mintro.py", line 234, in run
    list_installed(installdata)
  File "mesonbuild/mintro.py", line 72, in list_installed
    for path, installdir, aliases, unknown1, unknown2 in installdata.targets:
ValueError: too many values to unpack (expected 5)
2018-06-06 06:59:06 +00:00
Jon Turney f31679dedd Fix non-list used with FeatureNewKwargs
The type of this argument needs checking, or single strings need handling correctly.
2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 48d49afe31 FeatureNew: Add decorators for new install_mode kwargs 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan c3ffc1a249 docs: Add a release notes snippet about FeatureNew 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan 9b314c9c24 FeatureNew: add two features that were just merged 2018-06-05 15:57:57 +00:00
Nirbheek Chauhan dff1d8eccf FeatureNew: Print WARNING instead of ERROR
ERROR is reserved for non-zero exit codes. People will probably get
confused.
2018-06-05 15:57:57 +00:00
Nirbheek Chauhan ad0121d259 Add prog/lib dirs from the mingw cross-compiler to PATH
These directories contain DLLs that the executable may need, such as
libstdc++-6.dll, libwinpthread, etc.
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan bc4dd5e201 .travis.yml: Add CI for armhf and mingw
Also split them out to their own jobs. Travis gives us 5 parallel jobs
now, so we can parallelize it a bit more.
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan eb383ef4a2 Automatically add cross-mingw root and sysroot bindir to WINEPATH
This ensures that all the system DLLs required by executables such as
libstdc++-6.dll can be found out of the box and tests can run
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan 21dc45dbbb Add MinGW-w64 64-bit to the Travis CI
Includes new cross files for MinGW-w64
2018-06-05 10:50:22 +00:00
Nirbheek Chauhan efa9b75d5d Set WINEPATH when running serialized executables
When the exe runner is `wine` or `wine32` or `wine64`, etc.
This allows people to run tests with wine.

Note that you also have to set WINEPATH to point to your custom
prefix(es) if your tests use external dependencies.

Closes https://github.com/mesonbuild/meson/issues/3620
2018-06-05 10:50:22 +00:00
Niklas Claesson 7fbab2c6e9 Update environment.py
Fix typo in environment.py
2018-06-04 23:46:14 +03:00
Aleksey Filippov d1f9303787 Add 'common/202 subproject array version' test 2018-06-03 21:10:56 +00:00
Aleksey Filippov 9e10628a69 Use mesonlib.version_compare_many() first value only as an indicator of match 2018-06-03 21:10:56 +00:00
mikolajp 2d1d6c3056 Fix meson multiple version contraint error 2018-06-03 21:10:56 +00:00
Jon Turney ac480c1857 Extend test_rc_depends_files test case
Extend test_rc_depends_files test case to also cover depfile generation for
a resource file generated by a custom_target
2018-06-03 21:06:23 +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 7e08e958c0 Allow substitutions in custom_target() depfile:
Allow substitutions in custom_target() depfile: as well as in command:
2018-06-03 21:06:23 +00:00
Jon Turney 50aabc0129 Document @PLAINNAME@ and @BASENAME@ substitutions in custom_target(command:)
Since f3ff8fe6 (0.39.0), this has a common implementation with the same
substitution in generators, but I think they existed earlier.

@BASENAME@ is used internally by the custom target generated by
windows.compile_resources()
2018-06-03 21:06:23 +00:00
Jon Turney d78fa6ffe3 Install implib where expected if default install_dir: is explicitly given
Install the implib into the default import lib directory if an explicit
install_dir: is given, but the value happens to be the same as the default.
2018-06-03 20:57:03 +00:00
Nirbheek Chauhan 8e8d3231ad Link to our Getting-meson page instead of python.org [skip ci] 2018-06-03 18:59:24 +00:00
Nirbheek Chauhan 0b9162c08d docs: Add a section about the MSI installer [skip ci] 2018-06-03 18:59:24 +00:00
Nirbheek Chauhan 107e061506 Error out when someone tries to use msys/python to run Meson
This mistake seems to be a very common hiccup for people trying to use
Meson with MSYS2 on Windows from git or with pip.

msys/python uses POSIX paths with '/' as the root instead of a drive
like `C:/`, and also does not identify the platform as Windows.

This means that configure checks will be wrong, and many build tools
will be unable to parse the paths that are returned by functions in
Python such as shutil.which.

Closes https://github.com/mesonbuild/meson/issues/3653
2018-06-03 18:59:24 +00:00
Nirbheek Chauhan fbc7160214 docs: Expand section on how to install Python3 and Meson
With screenshots!
2018-06-03 18:59:24 +00:00
Marvin Scholz d777ffc040 Fix #mesondefine token error message formatting 2018-06-03 21:28:47 +03:00
Mathieu Duponchelle 9e7b0dd704 test extra paths: move test to windows 2018-06-02 11:42:48 +00:00
Mathieu Duponchelle b3feff3032 test extra paths: add extra paths for all build targets 2018-06-02 11:42:48 +00:00
Mathieu Duponchelle bd2cc39f26 test extra paths: add test case 2018-06-02 11:42:48 +00:00
Mathieu Duponchelle 35ab34d6cd test serialisation: determine windows extra paths ..
..  for executable arguments too.

This makes it possible to pass an executable to a test, which
can then run it in an appropriate environment.
2018-06-02 11:42:48 +00:00
Filipe Brandenburger 968f2c63af Add release-notes snippet for the extended install_mode 2018-06-02 04:50:32 +00:00
Filipe Brandenburger 73decf31f1 Update reference manual to include 'install_mode' where supported 2018-06-02 04:50:32 +00:00
Filipe Brandenburger 04c39ad562 Add extended unit test for 'install_mode'
This new unit test will use the targets in '198 install_mode' and
confirm that every file and directory gets the expected mode, ensuring
that the setting is properly applied at install time.
2018-06-02 04:50:32 +00:00
Filipe Brandenburger 862e1dd838 Add test case for 'install_mode'
This is a simple test case, checking for installed_files.txt, which just
makes sure the syntax is accepted.

Manual tests confirmed the permissions were set correctly.

A follow up commit adds a unit test based on this directory.
2018-06-02 04:50:32 +00:00
Filipe Brandenburger df2f6a71e7 Make windows_proof_rmtree resilient to read-only files
Start the process by traversing the tree and adding the S_IWRITE and
S_IREAD bits to the file's mode (which are also preserved on Windows.)

This fixes windows_proof_rmtree's inability to remove read-only files,
which was uncovered in testing the new `install_mode` feature.

Tested: ./run_tests.py passes on Linux, appveyor CI on Windows passes.
2018-06-02 04:50:32 +00:00
Filipe Brandenburger 05c43cdcd1 Add 'install_mode' to all installable targets
This makes it possible to customize permissions of all installable
targets, such as executable(), libraries, man pages, header files and
custom or generated targets.

This is useful, for instance, to install setuid/setgid binaries, which
was hard to accomplish without access to this attribute.
2018-06-02 04:50:32 +00:00
Filipe Brandenburger 0ccc0e92d1 Check mode of file, not subdirectory, in install_subdir.
When using an install_mode in install_subdir(), that should apply to the
files and not to the directory tree.

Otherwise, an install_mode not including the executable bit will make
the tree inaccessible, since directories need it to be traversed.

If the mode needs to be applied to both files and directories, then
install_subdir() is only useful to install files with the executable bit
set, which is not really that useful...

So default to just using the umask for the directories and applying
install_mode to the files only.

This can be reviewed in the future, possibly by adding a separate
install_dir_mode attribute, or perhaps adding an optional fourth field
to FileMode with the mode for directories (this is similar to how RPM
handles specifying mode of directory trees recursively added to the
package.)
2018-06-02 04:50:32 +00:00
Jon Turney 6bab3d40a9 Fix assertRebuiltTarget with VS backend
For the VS backend, assertRebuiltTarget() asserts the that target is both
recompiled and relinked.  This isn't correct for test_rc_depends_files, as
changing the rc script's dependencies only causes the executable to be
relinked, and not to also have it's source recompiled.

assertRebuiltTarget already gets this right for the ninja backend.
2018-06-01 20:21:09 +00:00
Jon Turney 7a48f6dfcd Clarify how Windows resource compiler uses the include path 2018-06-01 20:21:09 +00:00
Jon Turney b7df392e9f Also run Windows unit tests on Cygwin 2018-06-01 20:21:09 +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
Jussi Pakkanen bf2e21ec0e
Merge pull request #3486 from Salamandar/salamandar/meson_version_introspection
Add FeatureNew and FeatureDeprecated, to alert the user of bad meson_version
2018-06-01 22:53:06 +03:00
Nirbheek Chauhan 0a035dea6d Set the meson command to use when we know what it is
Instead of using fragile guessing to figure out how to invoke meson,
set the value when meson is run. Also rework how we pass of
meson_script_launcher to regenchecker.py -- it wasn't even being used

With this change, we only need to guess the meson path when running
the tests, and in that case:

1. If MESON_EXE is set in the env, we know how to run meson
   for project tests.
2. MESON_EXE is not set, which means we run the configure in-process
   for project tests and need to guess what meson to run, so either
   - meson.py is found next to run_tests.py, or
   - meson, meson.py, or meson.exe is in PATH

Otherwise, you can invoke meson in the following ways:

1. meson is installed, and mesonbuild is available in PYTHONPATH:
   - meson, meson.py, meson.exe from PATH
   - python3 -m mesonbuild.mesonmain
   - python3 /path/to/meson.py
   - meson is a shell wrapper to meson.real
2. meson is not installed, and is run from git:
   - Absolute path to meson.py
   - Relative path to meson.py
   - Symlink to meson.py

All these are tested in test_meson_commands.py, except meson.exe since
that involves building the meson msi and installing it.
2018-06-01 19:20:04 +00:00
Mathieu Duponchelle 14750b50ea configure_file: Add output_format kwarg (#3636)
* configure_file: Add output_format kwarg

* docs: Reference-manual.md output_format was added in 0.47 [skip ci]
2018-06-01 17:53:07 +00:00