aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-08run_unittests.sh: fix Python DeprecationWarningPaolo Bonzini1-1/+1
Fix the following Python error: D:\a\1\s\run_unittests.py:6654: DeprecationWarning: invalid escape sequence \ self.assertEqual(libhello_nolib.get_pkgconfig_variable(escaped_var, {}), hello world) Use a raw string literal.
2021-06-08interpreter: add feature.disable_auto_if()Paolo Bonzini3-0/+24
Add a method to downgrade an option to disabled if it is not used. This is useful to avoid unnecessary search for dependencies; for example dep = dependency('dep', required: get_option('feature').disable_auto_if(not foo)) can be used instead of the more verbose and complex if get_option('feature').auto() and not foo then dep = dependency('', required: false) else dep = dependency('dep', required: get_option('feature')) endif or to avoid unnecessary dependency searches: dep1 = dependency('dep1', required: get_option('foo')) # dep2 is only used together with dep1 dep2 = dependency('dep2', required: get_option('foo').disable_auto_if(not dep1.found())) ``` Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-06-08interpreter: add feature.require()Paolo Bonzini6-2/+57
Add a method to perform a logical AND on a feature object. The method also takes care of raising an error if 'enabled' is ANDed with false. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-31interpreter: wrap access to Feature valuePaolo Bonzini1-4/+8
This will allow adding "forced-off" Feature objects in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-31interpreter: add feature.allowed()Paolo Bonzini3-0/+11
This method simplifies the conversion of Feature objects to booleans. Often, one has to use the "not" operator in order to treat "auto" and "enabled" the same way. "allowed()" also works well in conjunction with the require method that is introduced in the next patch. For example, if get_option('foo').require(host_machine.system() == 'windows').allowed() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif can be used instead of if host_machine.system() != 'windows' if get_option('foo').enabled() error('...') endif endif if not get_option('foo').disabled() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-30modules/fs: Use typed_kwargsDylan Baker1-7/+11
2021-05-30interpreterbase: Add a function for type checking keyword argumentsDylan Baker2-0/+233
2021-05-30Don't use `os.path.relpath` in dist commandNaveen M K1-1/+1
This is problematic when we meson is installed in the different root(say C:) while building from another root(say D:). This is how it is done in mesonpep517 and causes problems because of that.
2021-05-30Only try to get RSP syntax if RSP is supported (#8804)Dylan Baker2-14/+24
2021-05-28vsenv: Recommend using "meson compile" wrapperXavier Claessens2-1/+12
When meson has setup the VS environment, running ninja to build won't work, user should use meson wrapper to compile.
2021-05-29Remove HFS workaround as everyone should use APFS by now.Jussi Pakkanen1-7/+0
2021-05-28unstable_external_project: Remove unused importsXavier Claessens1-2/+1
2021-05-28modules: Replace find_program_impl() by state.find_program()Xavier Claessens6-54/+47
2021-05-28modules: Add methods dict everywhereXavier Claessens20-19/+113
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-28modules: Stop using ModuleReturnValue where it's not neededXavier Claessens9-61/+45
It is only needed in functions that need to add targets to the interpreter.
2021-05-28modules: Stop using InterpreterObjectXavier Claessens7-70/+79
Custom objects returned by modules must be subclass of ModuleObject and have the state argument in its methods. Add MutableModuleObject base class for objects that needs to be deep copied on assignation.
2021-05-28modules: Remove snippet methodsXavier Claessens13-65/+38
The only advantage they have is they have the interpreter in arguments, but it's already available as self.interpreter. We should discourage usage of the interpreter API and rely on ModuleState object instead in the future. This also lift the restriction that a module method cannot add build targets, but that was not enforced for snippet methods anyway (and some modules were doing it) and it's really loose restriction as it should check for many other things if we wanted to make it consistent.
2021-05-28Remove `Microsoft.VisualStudio.Workload.WDExpress`Naveen M K1-1/+0
2021-05-28Find Visual Studio Build Tools 2019Naveen M K1-9/+19
Got the Idea from setuptools https://github.com/pypa/setuptools/blob/a5131f0b82e098da6c07a03a47f36f3a52f73fb6/setuptools/msvc.py#L176
2021-05-28Vala: Add missing FeatureNew() when C is missingXavier Claessens1-0/+1
It was previously an hard error, only permitted since 0.59.0.
2021-05-28Add a helper to simplify the usage of PerMachineDefaultableDylan Baker3-24/+29
2021-05-28tests: Add a test for dependencies with native set in a host == build ↵Dylan Baker2-0/+32
configuration
2021-05-28build: Use a PerMachineDefaultable for (project|global)[_link]_argsDylan Baker1-4/+15
2021-05-28coredata: Use a PerMachineDefaultable for the deps cacheDylan Baker1-5/+9
2021-05-28build: Use a PerMachineDefaultable for dependency override cacheDylan Baker1-2/+8
This way if we're doing a host == build configuration then the build and host dependencies will be stored correctly.
2021-05-28mesonlib: Allow PerMachineDefaultable to take arguments at initializationDylan Baker1-2/+2
2021-05-28dependencies/zlib: System Dependency needs a clib_compiler on windowsDylan Baker1-3/+8
Otherwise it'll except when it tries to get an attribute from None that doesn't exist.
2021-05-28mesonlib: Fix return type of PerMachineDefaultable.default_missing()Dylan Baker1-1/+1
2021-05-28build: fix type annotation importDylan Baker1-1/+1
2021-05-28modules/gnome: Correctly handle generated sources for generate_girDylan Baker3-7/+39
We need to pass any generated sources down the CustomTarget inititalizers so that they will generate a dependency correctly, otherwise we get race conditions.
2021-05-27test cases: Disable whole archive test on older VS IDEChun-wei Fan1-0/+4
The pre-2015 Visual Studio IDE do not handle things correctly for this test, so disable this.
2021-05-27MSVC: Always enable common tests 137 and 170Chun-wei Fan2-15/+0
This will test the "whole archive" and "generator link whole" for all Visual C++ versions.
2021-05-27ninjabackend.py: Implement `link_whole:` for pre-VS2015Chun-wei Fan1-3/+20
...Update 2, to be exact, since the Visual Studio linker only gained the `/WHOLEARCHIVE:` feature since Visual Studio 2015 Update 2. This checks whether we have the corresponding `cl.exe` which is versioned at or after Visual Studio 2015 Update 2 before we try to apply the `/WHOLEARCHIVE:xxx` linker flag. If we aren't, use built-in methods in Meson to grab the object files of the dependent static lib's, along with the objects that were `link_whole:`'ed into them, and feed this list into the linker instead. This would make `link_whole:` work on Visual Studio 2015 Update 1 and earlier, including previous Visual Studio versions.
2021-05-26Update chat info. [skip ci]Jussi Pakkanen1-4/+5
2021-05-23Also skip VS activation if gcc is found.Jussi Pakkanen1-0/+2
2021-05-23Fix double negative in 'No CMake binary not found'Jon Turney1-1/+1
2021-05-23Add swift executable support in Xcode.Jussi Pakkanen3-7/+14
2021-05-23Handle macOS filesystem sometimes setting lower digits to zero.Jussi Pakkanen1-1/+15
2021-05-23Fix text used to validate test output.Jussi Pakkanen1-1/+1
2021-05-23Rename VERSION because case insensitive file systems are a thing.Jussi Pakkanen2-1/+1
2021-05-23Merge pull request #8787 from mesonbuild/xcodeprojecttreeJussi Pakkanen1-54/+112
Rework Xcode project navigation tree
2021-05-23Merge pull request #8786 from jon-turney/cygwin-tests-reenableJussi Pakkanen11-34/+17
Re-enable various tests on Cygwin
2021-05-23Remove unnecessary hierarchical layer.Jussi Pakkanen1-10/+4
2021-05-23Remove top level sources entry as unnecessary.Jussi Pakkanen1-24/+6
2021-05-23Add meson.build files to pbxgroup.Jussi Pakkanen1-9/+31
2021-05-23Write project info in a tree structure rather than the current flat one.Jussi Pakkanen1-37/+97
2021-05-23Disable D test on macOS as it fails mysteriously.Jussi Pakkanen1-0/+5
2021-05-23It seems ld64 is the default linker name on macOS now.Jussi Pakkanen1-1/+5
2021-05-22Better detection of Visual Studio compilerJacob Nielsen1-0/+8
2021-05-21Fix LTO test on CygwinJon Turney4-8/+15
This partially reverts commit add502c6483bde9dc6a0ba80b3c79163304465a4. In 'linkshared' test, annotate cppfunc() as imported, so an indirection through an import stub is generated, avoiding a relocation size error when building using gcc for Cygwin with LTO on. Align with the example of how to write this portably in [1]. The 'c' language part of that test already gets this right. [1] http://gcc.gnu.org/wiki/Visibility