Commit Graph

680 Commits

Author SHA1 Message Date
Jussi Pakkanen 36a0d162cb Merge pull request #895 from mesonbuild/wip/tingping/gnome-vapi
gnome: Add generate_vapi function
2016-11-02 11:41:58 -07:00
Jussi Pakkanen 97c2321740 Merge pull request #949 from centricular/has-function-xcode8-fixes
Fix has_function with XCode 8 and related changes
2016-11-02 11:41:32 -07:00
Jussi Pakkanen 6762d30c6a Exposes the install names of targets in introspection. Closes #829. 2016-10-30 06:46:08 -07:00
Jussi Pakkanen 43a8ef72fc Merge pull request #965 from schultetwin/serialize_native_executable_exe_wrapper_cross_build
Serialize native executable exe wrapper cross build
2016-10-30 06:44:19 -07:00
Nirbheek Chauhan b8ef693a2a Clang also supports gnu89/99/11, gnu++03/11/14/1z
The list of supported standards is identical for GCC and Clang.

We don't list duplicate standard names however, such as c++03 and c++09

https://github.com/llvm-mirror/clang/blob/master/include/clang/Frontend/LangStandards.def
2016-10-30 06:43:49 -07:00
Mark Schulte 1e4bdea7d8 Allow running native executable in cross build
Make so both executable() targets that are marked as native and
external programs (which are usually build tools compiled for the
host machine) are not supposed to be run with the exe wrapper.
2016-10-27 14:42:43 -07:00
Scott D Phillips ba578db031 mesonlib: close file before (re)moving
On windows, attempting to unlink an open file results in a
PermissionError, so close the file and then remove it.
2016-10-27 10:52:00 -07:00
Nirbheek Chauhan b05d37db67 compilers: Ignore pthread flags when using MSVC
They don't make sense and just cause a build failure.
2016-10-27 10:51:26 -07:00
Jussi Pakkanen 33323bb7e3 Merge pull request #952 from centricular/deterministic-sources-outputs
Ninja: Use OrderedDict in places where order matters
2016-10-26 14:16:18 -07:00
Nirbheek Chauhan 5ffb0bcd0d Use *FLAGS from the env in compiler checks
Every other build system does this, and at least OS X, iOS, and Android
depend on this to select the OS versions that your application is
targetting.

At the same time, just use a wrapper for self.run and self.links to
share the common (identical) code.
2016-10-26 23:16:06 +05:30
Nirbheek Chauhan 3df75d696d Directly pass the compiler to get_args_from_envvars
Seems better to do this since the behaviour is compiler-specific. Would
be easier to extend this later too in case we want to do more
compiler-specific things.
2016-10-26 23:16:05 +05:30
Nirbheek Chauhan 4be8e71fb3 has_function: Try to use the function being checked
Simply placing a reference to it isn't enough for the linker to try and
think it's being used and do a symbol availability check with
-Wl,-no_weak_imports on OS X ld.
2016-10-26 23:16:04 +05:30
Jussi Pakkanen 2d058bdcff Merge pull request #912 from valum-framework/wip/vala-custom-header-and-vapi
vala: Custom header and vapi name (fix #892)
2016-10-25 10:06:49 -07:00
Guillaume Poirier-Morency 66518d4dad vala: Use a portable path join for the VAPI 2016-10-25 10:57:40 -04:00
Nirbheek Chauhan 706425abd1 Ninja: Use OrderedDict in places where order matters
Specifically, wherever we have sources or outputs, we want to use an
OrderedDict so that the build is always deterministic. It was reported
by Olexa Bilaniuk that `ar D` creates static libraries with different
checksums depending on the order of the object files.

See: https://github.com/mesonbuild/meson/pull/951

We don't actually want to preserve the order in which they are listed.
We just want the order to be deterministic and predictable.
2016-10-25 14:36:16 +05:30
Nirbheek Chauhan a06178f58f Add -Wl,-no_weak_imports to has_function with XCode 8
This is needed to ensure that symbol availability checks actually fail
at link time (instead of at runtime) which is necessary for has_function
to work correctly.
2016-10-25 09:44:15 +05:30
Nirbheek Chauhan ac58c13bbf has_function: Only ignore prototype when no includes are specified
The Autoconf-style check we were doing gives false positives when the
linker uses the prototype defined in the SDK header to decide whether
a function is available or not.

For example, with macOS 10.12, clock_gettime is now implemented
(alongwith other functions). These functions are always defined in the
XCode 8 SDK as weak imports and you're supposed to do a runtime check to
see if the symbols are available and use fallback code if they aren't.

The linker will always successfully link if you use one of those symbols
(without a runtime fallback) even if you target an older OS X version
with -mmacosx-version-min. This is the intended behaviour by Apple.

But this makes has_function useless because to test if the symbol is
available, we must know at link-time whether it is available.

To force the linker to do the check at link-time you must use
'-Wl,-no_weak_imports` *and* use the prototype in time.h which has an
availability macro which tells the linker whether the symbol is
available or not based on the -mmacosx-version-min flag.

An autoconf-style check would override this prototype and use its own
which would result in the linker thinking that the function is always
available (a false positive). Worse, this would manifest at runtime and
might not be picked up immediately.

We now use the function prototype in the user-provided includes if the
'prefix' kwarg contains a `#include` and use the old Autoconf-style
check if not. I've tested that the configure checks done by GStreamer
and GLib are completely unaffected by this; at least on Linux.

The next commit will also add `-Wl,-no_weak_imports` to extra_args by
default so that Meson avoids this mess completely. We always want this
because the user would not do a has_function check if they have
a runtime fallback for the function in their code.
2016-10-25 09:44:15 +05:30
Nirbheek Chauhan 02a2d69270 compilers: Derive ClangObj*Compiler from ClangCompiler too
The Clang ObjC/++ compiler is the same as the C/++ compiler.
2016-10-25 09:44:15 +05:30
Guillaume Poirier-Morency 114b5b0637 vala: Use 'vala_header' and 'vala_vapi' directly
Move the fallback logic into 'BuildTarget.process_kwargs' to use the
target name instead.
2016-10-24 18:01:27 -04:00
Guillaume Poirier-Morency ff6b3c7a2d vala: Custom header and vapi name (fix #892) 2016-10-24 18:01:27 -04:00
Jussi Pakkanen 3c48bd2d88 Revert d9473095f2 because it broke GStreamer. 2016-10-24 12:16:28 -07:00
Aurelien Jarno caa1ef6318 Fix depfixer on MIPS. 2016-10-24 12:14:42 -07:00
Jussi Pakkanen a76f9cfe3b Merge pull request #915 from centricular/dependency-error-msg-and-more
Improve error when using the dependencies kwarg
2016-10-23 08:56:39 -07:00
Patrick Griffis d9473095f2 gnome: Don't pass ldflags to g-ir-scanner
In this context -l refers to shared libraries that the gir
provides so you end up with a dozen unecessary libs in your
gir file.
2016-10-23 08:53:27 -07:00
Patrick Griffis 423c8dbb40 gettext: Add update-po target
For each project this creates a <project>-update-po target.
When ran this updates the pot file and then merges it back
into the po files in the source directory with `msgmerge`
for project maintainers and translators.

Fixes #819
2016-10-23 08:46:48 -07:00
Nirbheek Chauhan 70265c3782 Improve error when using the dependencies kwarg
The error message is misleading (talks about external dependencies), and
doesn't tell you what you need to do (use the output of
declare_dependency, dependency, or find_library). At the same time
rename add_external_deps to add_deps since it adds internal deps too.

Plus many more error message improvements all over the place.
2016-10-23 18:02:19 +05:30
Nirbheek Chauhan f79c4396f8 Add repr() implementation for Dependency()
Easier to debug
2016-10-23 18:02:02 +05:30
Jussi Pakkanen b50f3e6976 Merge pull request #934 from mesonbuild/wip/tingping/gnome-yelp
gnome: Add yelp() function
2016-10-23 04:39:15 -07:00
Jussi Pakkanen 5f20b38d44 Force configure input files to be utf-8. Closes #927. 2016-10-23 04:38:54 -07:00
Guillaume Poirier-Morency f7a60099f6 pkgconfig: Fix absolute 'libdir' and 'includedir' 2016-10-23 04:38:34 -07:00
Patrick Griffis ed3cc537cb gnome: Fix building gobject-introspection with sanitizer
Fixes #922
2016-10-22 15:04:16 -07:00
Jussi Pakkanen 885a3c706f Merged dpkg-architecture fix for Gentoo. 2016-10-23 01:01:21 +03:00
Jussi Pakkanen 1e3e22c66e Merge pull request #938 from centricular/fix-unity-builds
Several commits that fix unity builds
2016-10-22 14:38:06 -07:00
Patrick Griffis 8b27a48d56 Don't default to lib64 if symlink
Some distros, such as Arch, symlink lib64 to lib for compat reasons
and programs shouldn't actually install there.
2016-10-22 14:37:46 -07:00
Jouni Kosonen 1ed3317a8b Only default to dpkg-architecture output in Debian derivatives 2016-10-22 14:00:46 +03:00
Patrick Griffis bae7d7b3d7 gnome: Add generate_vapi() function
This allows C projects to generate vapi bindings from
gir files and returns a dependency that can be used by
Vala.
2016-10-21 02:23:54 -04:00
Nirbheek Chauhan 7e9203fac9 Fix Unity builds for Fortran and D targets
Also warn if we're trying to use a unity build on a target with fortran
or D sources.
2016-10-21 08:39:12 +05:30
Nirbheek Chauhan 57ce7d4618 Add support for extracting objects in unity builds
Not only does extract_all_objects() now work properly again,
extract_objects() also works if you specify a subset of sources all of
which have been compiled into a single unified object.

So, for instance, this allows you to extract all the objects
corresponding to the C sources compiled into a target consisting of
C and C++ sources.
2016-10-21 08:00:39 +05:30
Nirbheek Chauhan 9c9c5ab2a8 Implement get_default_suffix in the base Compiler class
This way every compiler has it implemented
2016-10-21 08:00:39 +05:30
Nirbheek Chauhan b070f505d3 ninja: Generate Vala compile rules after all header_deps are found
Same reason as generated C sources
2016-10-21 08:00:39 +05:30
Nirbheek Chauhan 8bee336e2a ninja: Always use RawFilename for unity sources and deps
The use of has_dir_part is a terrible back that we need to move away
from. This will eventually be fixed by always using File() objects
everywhere. For now, this is needed for unity builds to work.
2016-10-21 07:30:02 +05:30
Nirbheek Chauhan 6f4406928b BuildTarget: Add compilers needed by generated sources 2016-10-21 07:11:11 +05:30
Nirbheek Chauhan 93035fd112 Print a useful error when unable to determine linker 2016-10-21 07:11:11 +05:30
Patrick Griffis 1781129740 gnome: Add yelp() function
Fixes #881
Mentioned in #295
2016-10-19 18:44:19 -04:00
AlexandreFoley 263cb6a5f0 add support of mercurial repo for wrap,… (#937)
* add support for wrap of mercurial repo, and a test with a clone of the sample subproject used for the git test into a mercuriel repo.

* Added myself to author list, and switched the URL of the sample subproject in the wrap file to one under the control of the project's maintainers.
2016-10-20 00:10:00 +03:00
Jussi Pakkanen e908910187 Can query pkg-config variables from the system. Closes #726. 2016-10-19 22:36:34 +03:00
Patrick Griffis 44690763b0 gnome: Include build dir in gtkdoc-mkhtml path 2016-10-19 21:16:29 +03:00
Jussi Pakkanen d367738ec7 Merge pull request #908 from centricular/vala-generated-sources
Support all kinds of generated vala and vapi sources
2016-10-19 21:15:22 +03:00
Patrick Griffis 22debf6ffc gnome: Fix gresource warning incorrectly being shown on 2.50+ 2016-10-19 21:15:05 +03:00
Nirbheek Chauhan 65e9761cb1 Support all kinds of generated vala and vapi sources
This is the first step in making Vala support have feature-parity with
C/C++ support. Vala and Vapi sources generated with Generators and
CustomTargets are no longer ignored. Dependencies are setup properly and
they are added to the commandline.
2016-10-19 20:46:04 +05:30