aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
AgeCommit message (Collapse)AuthorFilesLines
2018-02-21Generate build rpath for pkg-config dependencies consisting of a one ↵Martin Hostettler1-1/+1
absolute path
2018-02-16Merge pull request #3069 from dcbaker/pch_one_argJussi Pakkanen1-10/+4
Fix targets with C and C++ code that use pre compiled headers
2018-02-15Only remove substring if it is part of stringNiklas Claesson1-3/+6
Fixes #2661
2018-02-14backends: Only add pch args that are appropriate for the compilerDylan Baker1-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
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov1-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
2017-12-16Do not extract object for header sourcesXavier Claessens1-2/+8
Closes #2716
2017-12-10Merge pull request #2745 from dcbaker/submit/haikuJussi Pakkanen1-1/+1
small fixes for haiku
2017-12-10Merge pull request #2697 from mesonbuild/custom-target-depends-serializeJussi Pakkanen1-12/+18
custom target: Consider all build depends while serializing
2017-12-07haiku: do not add pthread argumentsDylan Baker1-1/+1
Haiku has pthreads, but they are part of the standard C library, and do not need either special compiler or linker flags.
2017-12-03Fix path for str arguments to depend_filesJoergen Ibsen1-2/+2
Fixes #2633
2017-12-03Merge pull request #2618 from mesonbuild/osxlinkerfixesJussi Pakkanen1-0/+2
Fix many things have have been slightly broken in OSX
2017-12-02custom target: Consider all build depends while serializingNirbheek Chauhan1-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.
2017-11-26spelling: verifierJosh Soref1-1/+1
2017-11-26Use absolute paths for rpaths on OSX.Jussi Pakkanen1-0/+2
2017-11-26spelling: overriddenJosh Soref1-2/+2
2017-10-02Merge pull request #2397 from mesonbuild/prebuiltJussi Pakkanen1-0/+24
Better support for prebuilt shared libs
2017-10-02Add rpath entries for all found libraries outside of system libraries.Jussi Pakkanen1-3/+8
2017-10-01backends: avoid extraneous trailing os.path.sep when joining pathsLiam Staskawicz1-2/+5
resolves #2336
2017-10-01Merge pull request #2313 from dcbaker/fix-2180Jussi Pakkanen1-0/+6
link_whole should be considered a source for targets
2017-10-01Fix MSVC builds.Jussi Pakkanen1-1/+3
2017-09-30Add an rpath entry to shared libraries that are linked from the source tree.Jussi Pakkanen1-0/+17
2017-09-30vs: Fix link_whole usage with the vs backendNirbheek Chauhan1-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.
2017-09-27Allow CustomTarget's to be indexedDylan Baker1-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
2017-09-12Merge pull request #1943 from QuLogic/duplicate-namesJussi Pakkanen1-17/+36
Fix creation of objects with duplicate names
2017-09-12Renamed test serialisation from is_cross to is_cross_built for clarity.Jussi Pakkanen1-5/+5
2017-09-12An external program is never a "cross test".Jussi Pakkanen1-0/+4
2017-08-18Make all functionality invokable via the main Meson binary,Jussi Pakkanen1-2/+4
which can be a Windows .exe file.
2017-08-14Fix object extraction in unity builds.Elliott Sales de Andrade1-12/+9
2017-08-14Use full relative paths to generate object names.Elliott Sales de Andrade1-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.
2017-08-14Use object_filename_from_source when creating objects.Elliott Sales de Andrade1-1/+1
This will ensure a consistent path between generated object names and names expected of extracted objects.
2017-07-20Support implibs for executables on WindowsJon Turney1-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)
2017-07-20Allow test to depend on executable target in cross build. (#2007)FredericHamel1-0/+2
* Add a crossbuild case in 'test case/common/1 trivial/meson.build' * Add native flags for crossbuild tests.
2017-06-27Merged Genie support.Jussi Pakkanen1-1/+1
2017-06-26Recognise .gs extension as a Vala sourceAlistair Thomas1-1/+1
2017-06-22Skip handling non-available dependenciesJens Georg1-0/+3
This way, an optional dependency can always be added on Vala targets without meson adding --pkg
2017-06-11Merge pull request #1927 from centricular/gir-rpath-linkJussi Pakkanen1-0/+9
Work around GNU ld bug with -rpath,$ORIGIN
2017-06-11gnome: Work around GNU ld bug with -rpath,$ORIGINNirbheek Chauhan1-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
2017-06-09dependencies: Add a new class ExternalDependencyNirbheek Chauhan1-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.
2017-06-02Don't add dependencies recursively while linkingNirbheek Chauhan1-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
2017-05-29Whitespace tweaks to reduce Flake8 warningsAlistair Thomas1-1/+0
2017-05-21Fix cross environment pollution.Ole André Vadla Ravnås1-3/+4
Environment variables like CFLAGS and LDFLAGS should not affect the cross environment. Fixes #1772
2017-05-17Use more direct dictionary literals.Elliott Sales de Andrade1-3/+1
2017-05-08Use 'generate_basic_compiler_args' for Vala targetsGuillaume Poirier-Morency1-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'.
2017-05-08Add support for @CURRENT_SOURCE_DIR@ in generator argumentsAlberto Aguirre1-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
2017-05-04Use American English - 'ise' -> 'ize' where applicablePeter Hutterer1-2/+2
2017-05-03Kill RawFile dead!Jussi Pakkanen1-0/+2
2017-05-02Don't use len() to test emptiness vs not emptinessDylan Baker1-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.
2017-04-17Merge pull request #1628 from ximion/dfixJussi Pakkanen1-1/+1
d: Fix linking shared libraries with DMD
2017-04-15d: Fix linking shared libraries with DMDMatthias Klumpp1-1/+1
2017-04-15Make it possible to only do unity builds on subprojects.Jussi Pakkanen1-1/+8