Commit Graph

198 Commits

Author SHA1 Message Date
Nirbheek Chauhan 165da6fb65 backends: Use a set while gathering RPATHs 2018-05-24 14:38:28 +00:00
Jussi Pakkanen 1918c0d231 Can combine D and C++ in a single target. Closes #3125. 2018-05-02 22:50:15 +03:00
Niklas Claesson 4f4cdee687 Allow custom_target do depend on indexed output of custom_target
Fixes: #3494
2018-05-01 11:51:55 +00:00
Jussi Pakkanen 9b0453d3e9
Merge pull request #3225 from filbranden/fixperms3
Introduce install_umask to determine permissions of files in install tree. Default it to 022
2018-04-26 23:14:00 +03:00
Xavier Claessens 9a82b0136a extract_all_objects: Add 'recursive' keyword argument
To maintain backward compatibility we cannot add recursive objects by
default. Print a warning when there are recursive objects to be pulled
and the argument is not set. After a while we'll do pull recursive
objects by default.
2018-04-18 14:54:52 -04:00
Xavier Claessens 60aaee55d4 extract_all_objects(): Recursively extract objects
Fixes #3401
2018-04-18 14:54:52 -04:00
Xavier Claessens b0e4d4047b Fix using object extracted from a unity build
- determine_ext_objs: What matters is if extobj.target is a unity build,
  not if the target using those objects is a unity build.
- determine_ext_objs: Return one object file per compiler, taking into
  account generated sources.
- object_filename_from_source: No need to special-case unity build, it
  does the same thing in both code paths.
- check_unity_compatible: For each compiler we must extract either none
  or all its sources, taking into account generated sources.
2018-04-18 14:49:52 -04:00
Filipe Brandenburger 8651d55c6a Add new builtin option --install-umask
This option controls the permissions of installed files (except for
those specified explicitly using install_mode option, e.g. in
install_data rules.)

An install-umask of 022 will install all binaries, directories and
executable files with mode rwxr-xr-x, while all data and non-executable
files will be installed with mode rw-r--r--.

Setting install-umask to the string 'preserve' will disable this
feature, keeping the permissions of installed files same as the files in
the build tree (or source tree for install_data and install_subdir.)
Note that, in this case, the umask used when building and that used when
checking out the source tree will leak into the install tree.

Keep the default as 'preserve', to show that no behavior is changed and
all tests keep passing unchanged.

Tested: ./run_tests.py
2018-04-18 11:44:54 -07:00
Jussi Pakkanen 628f910760
Merge pull request #3314 from sarum9in/test_depends
Add test(depends) keyword parameter
2018-04-18 00:40:52 +03:00
Elliott Sales de Andrade dbb025a175 Add an OpenMP dependency.
This works similarly to the thread dependency which stores the various
inconsistent flags in each compiler.
2018-04-17 02:04:37 -04:00
Xavier Claessens 809f018333 extract_all_objects: Also extract generated sources 2018-04-03 15:20:19 -04:00
Aleksey Filippov c18ceac040 Add depends keyword to test() function 2018-03-25 01:33:33 +00:00
Aleksey Filippov 2febb99eee Fix b_ndebug=if-release option
Provide get_{type}_options_for_target() methods that unite {type} and builtin options.
2018-03-21 17:30:06 +00:00
Aleksey Filippov 7f042b5fe2 Use target.get_id() instead of basename and type_suffix concatenation at 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.
2018-03-15 21:14:58 +02:00
Hemmo Nieminen 4611097654 Include project name in a test object. 2018-02-25 21:44:59 +02:00
Martin Hostettler 1e82416a93 Generate build rpath for pkg-config dependencies consisting of a one absolute path 2018-02-21 19:10:16 +02:00
Jussi Pakkanen d2445a15a1
Merge pull request #3069 from dcbaker/pch_one_arg
Fix targets with C and C++ code that use pre compiled headers
2018-02-16 00:08:06 +02:00
Niklas Claesson e88887be4a Only remove substring if it is part of string
Fixes #2661
2018-02-15 22:45:54 +02:00
Dylan Baker b11035693c backends: Only add pch args that are appropriate for the compiler
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-02-14 11:34:07 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
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
2018-01-30 07:08:22 +11:00
Xavier Claessens 63d2f0bf07 Do not extract object for header sources
Closes #2716
2017-12-16 12:51:08 +02:00
Jussi Pakkanen cbefb57ffe
Merge pull request #2745 from dcbaker/submit/haiku
small fixes for haiku
2017-12-10 14:42:53 +02:00
Jussi Pakkanen 5ff9e05c8b
Merge pull request #2697 from mesonbuild/custom-target-depends-serialize
custom target: Consider all build depends while serializing
2017-12-10 14:23:31 +02:00
Dylan Baker fc547ad05e haiku: do not add pthread arguments
Haiku has pthreads, but they are part of the standard C library, and do
not need either special compiler or linker flags.
2017-12-07 09:35:12 -08:00
Joergen Ibsen 521933357d Fix path for str arguments to depend_files
Fixes #2633
2017-12-03 23:24:30 +02:00
Jussi Pakkanen 554b484468
Merge pull request #2618 from mesonbuild/osxlinkerfixes
Fix many things have have been slightly broken in OSX
2017-12-03 02:25:44 +02:00
Nirbheek Chauhan 62ba5ca1ec custom target: Consider all build depends while serializing
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-12-02 02:07:19 +05:30
Josh Soref eb2a148218 spelling: verifier 2017-11-26 17:28:09 +00:00
Jussi Pakkanen fa6f01d096 Use absolute paths for rpaths on OSX. 2017-11-26 17:34:01 +02:00
Josh Soref 49f8d28ef5 spelling: overridden 2017-11-26 05:55:40 +00:00
Jussi Pakkanen 9483875798 Merge pull request #2397 from mesonbuild/prebuilt
Better support for prebuilt shared libs
2017-10-02 19:09:08 +03:00
Jussi Pakkanen ec45c29c9d Add rpath entries for all found libraries outside of system libraries. 2017-10-02 01:30:30 +03:00
Liam Staskawicz ae532c807c backends: avoid extraneous trailing os.path.sep when joining paths
resolves #2336
2017-10-01 15:39:04 +03:00
Jussi Pakkanen ea5ae8ef27 Merge pull request #2313 from dcbaker/fix-2180
link_whole should be considered a source for targets
2017-10-01 01:19:05 +03:00
Jussi Pakkanen cb64a3f07a Fix MSVC builds. 2017-10-01 01:11:02 +03:00
Jussi Pakkanen a655b64989 Add an rpath entry to shared libraries that are linked from the source tree. 2017-09-30 18:21:02 +03:00
Nirbheek Chauhan 8cc52b5d4f vs: Fix link_whole usage with the vs backend
/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-30 04:11:22 +05:30
Dylan Baker dda5e8cadb Allow CustomTarget's to be indexed
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-27 22:01:24 +03:00
Jussi Pakkanen 75208604da Merge pull request #1943 from QuLogic/duplicate-names
Fix creation of objects with duplicate names
2017-09-12 20:37:43 +03:00
Jussi Pakkanen b63710863b Renamed test serialisation from is_cross to is_cross_built for clarity. 2017-09-12 20:32:07 +03:00
Jussi Pakkanen 9b50a4aac1 An external program is never a "cross test". 2017-09-12 20:32:07 +03:00
Jussi Pakkanen 50fb7d37ab Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
2017-08-18 12:08:20 +03:00
Elliott Sales de Andrade 320862991a Fix object extraction in unity builds. 2017-08-14 22:47:36 -04:00
Elliott Sales de Andrade bf0164ff6e Use full relative paths to generate object names.
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-14 22:47:36 -04:00
Elliott Sales de Andrade b68cb3c713 Use object_filename_from_source when creating objects.
This will ensure a consistent path between generated object names and
names expected of extracted objects.
2017-08-14 22:47:35 -04:00
Jon Turney 3fa3922cea Support implibs for executables on Windows
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-20 21:11:56 +01:00
FredericHamel 6f4e5e96d8 Allow test to depend on executable target in cross build. (#2007)
* Add a crossbuild case in 'test case/common/1 trivial/meson.build'

* Add native flags for crossbuild tests.
2017-07-20 12:25:59 +03:00
Jussi Pakkanen dfb0414d9c Merged Genie support. 2017-06-27 19:01:00 +03:00
Alistair Thomas cca0fa8154 Recognise .gs extension as a Vala source 2017-06-26 13:57:52 +01:00
Jens Georg ce3cec40da Skip handling non-available dependencies
This way, an optional dependency can always be added on Vala targets without
meson adding --pkg
2017-06-22 10:59:55 +02:00