summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix b_ndebug=if-release optionAleksey Filippov2018-03-211-3/+22
| | | | Provide get_{type}_options_for_target() methods that unite {type} and builtin options.
* Use target.get_id() instead of basename and type_suffix concatenation at ↵Aleksey Filippov2018-03-151-10/+4
| | | | | | | | | | | | | | | call site Fixes the bug with flat layout and identical target names in subprojects. Without this change directories are not created with subproject prefix and they can collide. Remove dead makedirs code in Backend.__init__(), during initialization of backend build.targets is empty. Create output directories in Vs2010Backend.generate_projects() instead. Also use double blank line in run_unittests.py according to https://www.python.org/dev/peps/pep-0008/#blank-lines.
* Include project name in a test object.Hemmo Nieminen2018-02-251-5/+6
|
* Generate build rpath for pkg-config dependencies consisting of a one ↵Martin Hostettler2018-02-211-1/+1
| | | | absolute path
* Merge pull request #3069 from dcbaker/pch_one_argJussi Pakkanen2018-02-161-10/+4
|\ | | | | Fix targets with C and C++ code that use pre compiled headers
| * backends: Only add pch args that are appropriate for the compilerDylan Baker2018-02-141-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | Currently we try both C and C++ when determining which PCH files to include. The problem with this approach is that if there are no C or C++ files (only headers) and the target has both C and C++ sources then the PCHs will be passed to the wrong compiler. The solution is less code, we already have the compiler, the compiler knows what language it is, so we don't need to walk both C and C++. Fixes #3068
* | Only remove substring if it is part of stringNiklas Claesson2018-02-151-3/+6
|/ | | | Fixes #2661
* Use os.path: basename() and dirname() instead of split()Aleksey Filippov2018-01-301-1/+1
| | | | | | | | | | | | According to Python documentation[1] dirname and basename are defined as follows: os.path.dirname() = os.path.split()[0] os.path.basename() = os.path.split()[1] For the purpose of better readability split() is replaced by appropriate function if only one part of returned tuple is used. [1]: https://docs.python.org/3/library/os.path.html#os.path.split
* Do not extract object for header sourcesXavier Claessens2017-12-161-2/+8
| | | | Closes #2716
* Merge pull request #2745 from dcbaker/submit/haikuJussi Pakkanen2017-12-101-1/+1
|\ | | | | small fixes for haiku
| * haiku: do not add pthread argumentsDylan Baker2017-12-071-1/+1
| | | | | | | | | | Haiku has pthreads, but they are part of the standard C library, and do not need either special compiler or linker flags.
* | Merge pull request #2697 from mesonbuild/custom-target-depends-serializeJussi Pakkanen2017-12-101-12/+18
|\ \ | |/ |/| custom target: Consider all build depends while serializing
| * custom target: Consider all build depends while serializingNirbheek Chauhan2017-12-021-12/+18
| | | | | | | | | | | | | | | | | | | | Currently, we only consider the build depends of the Executable being run when serializing custom targets. However, this is not always sufficient, for example if the executable loads modules at runtime or if the executable is actually a python script that loads a built module. For these cases, we need to set PATH on Windows correctly or the custom target will fail to run at build time complaining about missing DLLs.
* | Fix path for str arguments to depend_filesJoergen Ibsen2017-12-031-2/+2
| | | | | | | | Fixes #2633
* | Merge pull request #2618 from mesonbuild/osxlinkerfixesJussi Pakkanen2017-12-031-0/+2
|\ \ | |/ |/| Fix many things have have been slightly broken in OSX
| * Use absolute paths for rpaths on OSX.Jussi Pakkanen2017-11-261-0/+2
| |
* | spelling: verifierJosh Soref2017-11-261-1/+1
| |
* | spelling: overriddenJosh Soref2017-11-261-2/+2
|/
* Merge pull request #2397 from mesonbuild/prebuiltJussi Pakkanen2017-10-021-0/+24
|\ | | | | Better support for prebuilt shared libs
| * Add rpath entries for all found libraries outside of system libraries.prebuiltJussi Pakkanen2017-10-021-3/+8
| |
| * Fix MSVC builds.Jussi Pakkanen2017-10-011-1/+3
| |
| * Add an rpath entry to shared libraries that are linked from the source tree.Jussi Pakkanen2017-09-301-0/+17
| |
* | backends: avoid extraneous trailing os.path.sep when joining pathsLiam Staskawicz2017-10-011-2/+5
| | | | | | | | resolves #2336
* | Merge pull request #2313 from dcbaker/fix-2180Jussi Pakkanen2017-10-011-0/+6
|\ \ | |/ |/| link_whole should be considered a source for targets
| * vs: Fix link_whole usage with the vs backendNirbheek Chauhan2017-09-301-0/+6
| | | | | | | | | | | | | | /WHOLEARCHIVE must go to AdditionalOptions, not AdditionalDependencies and we must add a project reference to trick msbuild/visual studio into building a target that is built from only libraries linked in via /WHOLEARCHIVE.
* | Allow CustomTarget's to be indexedDylan Baker2017-09-271-1/+1
|/ | | | | | | | | | | This allows a CustomTarget to be indexed, and the resulting indexed value (a CustomTargetIndex type), to be used as a source in other targets. This will confer a dependency on the original target, but only inserts the source file returning by index the original target's outputs. This can allow a CustomTarget that creates both a header and a code file to have it's outputs split, for example. Fixes #1470
* Merge pull request #1943 from QuLogic/duplicate-namesJussi Pakkanen2017-09-121-17/+36
|\ | | | | Fix creation of objects with duplicate names
| * Fix object extraction in unity builds.Elliott Sales de Andrade2017-08-141-12/+9
| |
| * Use full relative paths to generate object names.Elliott Sales de Andrade2017-08-141-5/+27
| | | | | | | | | | | | | | This prevents files with the same name from different directories from producing object files with the same name and breaking ninja. Fixes #1494.
| * Use object_filename_from_source when creating objects.Elliott Sales de Andrade2017-08-141-1/+1
| | | | | | | | | | This will ensure a consistent path between generated object names and names expected of extracted objects.
* | Renamed test serialisation from is_cross to is_cross_built for clarity.Jussi Pakkanen2017-09-121-5/+5
| |
* | An external program is never a "cross test".Jussi Pakkanen2017-09-121-0/+4
| |
* | Make all functionality invokable via the main Meson binary,Jussi Pakkanen2017-08-181-2/+4
|/ | | | which can be a Windows .exe file.
* Support implibs for executables on WindowsJon Turney2017-07-201-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Add a boolean 'implib' kwarg to executable(). If true, it is permitted to use the returned build target object in link_with: On platforms where this makes sense (e.g. Windows), an implib is generated for the executable and used when linking. Otherwise, it has no effect. (Rather than checking if it is a StaticLibrary or SharedLibary, BuildTarget subclasses gain the is_linkable_target method to test if they can appear in link_with:) Also install any executable implib in a similar way to a shared library implib, i.e. placing the implib in the appropriate place Add tests of: - a shared_module containing a reference to a symbol which is known (at link time) to be provided by the executable - trying to link with non-implib executables (should fail) - installing the implib (This last one needs a little enhancement of the installed file checking as this is the first install test we have which needs to work with either MSVC-style or GCC-style implib filenames)
* Allow test to depend on executable target in cross build. (#2007)FredericHamel2017-07-201-0/+2
| | | | | | * Add a crossbuild case in 'test case/common/1 trivial/meson.build' * Add native flags for crossbuild tests.
* Merged Genie support.Jussi Pakkanen2017-06-271-1/+1
|\
| * Recognise .gs extension as a Vala sourceAlistair Thomas2017-06-261-1/+1
| |
* | Skip handling non-available dependenciesJens Georg2017-06-221-0/+3
|/ | | | | This way, an optional dependency can always be added on Vala targets without meson adding --pkg
* Merge pull request #1927 from centricular/gir-rpath-linkJussi Pakkanen2017-06-111-0/+9
|\ | | | | Work around GNU ld bug with -rpath,$ORIGIN
| * gnome: Work around GNU ld bug with -rpath,$ORIGINNirbheek Chauhan2017-06-111-0/+9
| | | | | | | | | | | | | | g-ir-scanner doesn't understand -rpath, so we use -L instead which has the same effect. Closes https://github.com/mesonbuild/meson/issues/1911
* | dependencies: Add a new class ExternalDependencyNirbheek Chauhan2017-06-091-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | This class now consolidates a lot of the logic that each external dependency was duplicating in its class definition. All external dependencies now set: * self.version * self.compile_args and self.link_args * self.is_found (if found) * self.sources * etc And the abstract ExternalDependency class defines the methods that will fetch those properties. Some classes still override that for various reasons, but those should also be migrated to properties as far as possible. Next step is to consolidate and standardize the way in which we call 'configuration binaries' such as sdl2-config, llvm-config, pkg-config, etc. Currently each class has to duplicate code involved with that even though the format is very similar. Currently only pkg-config supports multiple version requirements, and some classes don't even properly check the version requirement. That will also become easier now.
* Don't add dependencies recursively while linkingNirbheek Chauhan2017-06-021-8/+4
| | | | | | | | | | | | | We were doing this on the basis of an old comment, but there was no test for it and I couldn't reproduce the issue with clang on Linux at all. Let's add a (somewhat comprehensive) test and see if it breaks anywhere if we stop doing this. Halves the size of gstreamer's build.ninja from 20M to 8.7M Closes https://github.com/mesonbuild/meson/issues/1057
* Whitespace tweaks to reduce Flake8 warningsAlistair Thomas2017-05-291-1/+0
|
* Fix cross environment pollution.Ole André Vadla Ravnås2017-05-211-3/+4
| | | | | | | Environment variables like CFLAGS and LDFLAGS should not affect the cross environment. Fixes #1772
* Use more direct dictionary literals.Elliott Sales de Andrade2017-05-171-3/+1
|
* Use 'generate_basic_compiler_args' for Vala targetsGuillaume Poirier-Morency2017-05-081-1/+12
| | | | | | | Move '-C' option into 'get_always_args' as we always generate C sources. Add a branch in the dependency management to perform Vala-specific work of adding '--pkg' and '--target-glib'.
* Add support for @CURRENT_SOURCE_DIR@ in generator argumentsAlberto Aguirre2017-05-081-0/+4
| | | | | | | | | | | | | Allow users to specify @CURRENT_SOURCE_DIR@ in generator arguments to specify the current target source directory. This is useful when creating protobuf generator objects in sub-directories because protoc will then generate files in the expected location. Fixes #1622. Remove stray semicolon Update documentation
* Use American English - 'ise' -> 'ize' where applicablePeter Hutterer2017-05-041-2/+2
|
* Kill RawFile dead!Jussi Pakkanen2017-05-031-0/+2
|
* Don't use len() to test emptiness vs not emptinessDylan Baker2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson has a common pattern of using 'if len(foo) == 0:' or 'if len(foo) != 0:', however, this is a common anti-pattern in python. Instead tests for emptiness/non-emptiness should be done with a simple 'if foo:' or 'if not foo:' Consider the following: >>> import timeit >>> timeit.timeit('if len([]) == 0: pass') 0.10730923599840025 >>> timeit.timeit('if not []: pass') 0.030033907998586074 >>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass') 0.1154778649979562 >>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass") 0.08259823200205574 >>> timeit.timeit('if len("") == 0: pass') 0.089759664999292 >>> timeit.timeit('if not "": pass') 0.02340641999762738 >>> timeit.timeit('if len("foo") == 0: pass') 0.08848102600313723 >>> timeit.timeit('if not "foo": pass') 0.04032287199879647 And for the one additional case of 'if len(foo.strip()) == 0', which can be replaced with 'if not foo.isspace()' >>> timeit.timeit('if len(" ".strip()) == 0: pass') 0.15294511600222904 >>> timeit.timeit('if " ".isspace(): pass') 0.09413968399894657 >>> timeit.timeit('if len(" abc".strip()) == 0: pass') 0.2023209120015963 >>> timeit.timeit('if " abc".isspace(): pass') 0.09571301700270851 In other words, it's always a win to not use len(), when you don't actually want to check the length.