aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
AgeCommit message (Collapse)AuthorFilesLines
2017-07-23gnome: Support new glib-genmarshal argumentsEmmanuele Bassi1-2/+14
The glib-genmarshal tool was rewritten in GLib 2.53.3, and now supports more command line arguments, such as: "--pragma-once": emits a "#pragma once" instead of the old header guards when generating the header file "--prototypes": emits the marshallers prototype when generating the source file "-D,-U": defines and undefines pre-processor symbols "--include-header": emits an "#include" directive when generating the source file for the specified header file Meson should take advantage of these new options, as they can be used to replace most of the ad hoc build rules that projects are currently using to implement the same thing. Instead of mapping each option to a named argument, I used the same approach as the compile_resources() and generate_gir() methods; the genmarshal() method now has an 'extra_args' argument that can be used to pass extra arguments to the glib-genmarshal tool.
2017-07-21gnome: Fix wrong include pathNicolas Dufresne1-3/+1
When dealing with the SharedLibrary or StaticLibrary include directories, we where not taking into acount that path are relative to the source tree. With proper helper, this works now. This fixues issue where the gir may be generated bug from headers found in the prefix.
2017-07-20gnome.genmarshal(): Include generated header in generated sourcePatrick Griffis1-1/+5
This silences any strict-prototype warnings if enabled.
2017-07-17gnome module: Add -lfoo after -Lbar LDFLAGSNirbheek Chauhan1-4/+5
Otherwise they won't take effect
2017-07-02Qapla'Jussi Pakkanen1-2/+4
2017-07-01Fix custom target sourcesJussi Pakkanen1-2/+4
2017-06-30Fix typo in generate_gir keyword name.Elliott Sales de Andrade1-1/+1
2017-06-26Fixed issues raised in review.Jussi Pakkanen1-19/+19
2017-06-26Converted some modules.Jussi Pakkanen1-0/+22
2017-06-22Merge pull request #1948 from mesonbuild/tingping/gnome-sanitize-fixesJussi Pakkanen1-4/+11
Fix gnome.generate_gir() with address sanitizer
2017-06-22Merge pull request #1966 from QuLogic/gtkdoc-librariesJussi Pakkanen1-1/+5
Small gtkdoc improvements
2017-06-21Merge pull request #1924 from mesonbuild/tingping/yelp-fixesJussi Pakkanen1-1/+1
Various yelp fixes
2017-06-19Add build include directory to gtkdoc source paths.Elliott Sales de Andrade1-0/+2
This enables gtkdoc to produce documentation on files that were generated, using configure_file, for example.
2017-06-19Add all internal dep rpaths to gnome module builds.Elliott Sales de Andrade1-0/+2
Running gtkdoc on a shared library that depends on another shared library would fail otherwise.
2017-06-19Use absolute path to target dir within gnome module.Elliott Sales de Andrade1-1/+1
Stuff like gtkdoc may not be run in the top-level build directory, so these paths need to be absolute. Fixes #1950.
2017-06-17gnome.generate_gir(): Fix linking to libasan if sanitizer enabledPatrick Griffis1-2/+9
This is a bit of a workaround linking directly to it but it is at least functional unlike before. Fixes #1910
2017-06-15gnome: Fix getting sanitize cflags for girPatrick Griffis1-2/+2
There was an API break somewhere and this wasn't kept in sync. Part of #1910
2017-06-11gnome: Guard all cflags passed to g-ir-scannerFlorian Müllner1-7/+6
While g-ir-scanner's compatible -I and -D flags cover what most dependencies use, there's no guarantee that a dependency's cflags don't include more exotic flags that conflict with the tool's own options. For a real world example, mozjs-38 has '-include some-header-file.h', which translates to '--include nclude another-file-to-scan.h' for the scanner; unless for some reason there's an 'nclude' GIR available on the system, the target will thus fail. For this purpose, g-ir-scanner allows explicitly marking some flags as preprocessor/compiler flags by guarding them with --cflags-begin and --cflags-end. Make sure it is used this for all cflags, not only for global and project flags.
2017-06-11gnome: Fix includedir cflagsFlorian Müllner1-1/+2
Include directories are passed with the -I flag to both the compiler and g-ir-scanner, not as input files.
2017-06-11Merge pull request #1927 from centricular/gir-rpath-linkJussi Pakkanen1-11/+32
Work around GNU ld bug with -rpath,$ORIGIN
2017-06-11gnome: Don't assume that a C compiler is being usedNirbheek Chauhan1-6/+12
2017-06-11gnome: Work around GNU ld bug with -rpath,$ORIGINNirbheek Chauhan1-5/+20
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-10gnome.yelp(): Default symlink_media to truePatrick Griffis1-1/+1
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-05-28Add mkdb_args support to gnome.gtkdoc()Emmanuele Bassi1-0/+1
There are cases where we need to specify arguments to gtkdoc-mkdb, like telling it to scan extensions that are not '.h' and '.c'. Let's add a new named argument to gnome.gtkdoc(), as well as the plumbing needed for the gtk-doc helper script.
2017-05-17Remove unused variables.Elliott Sales de Andrade1-1/+1
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-21Stricter evaluation of deps. Closes #1648.Jussi Pakkanen1-6/+10
2017-04-13Merge pull request #1548 from ssssam/sam/stable-orderingJussi Pakkanen1-5/+5
Stable ordering of some commandlines generated by 'gnome' module
2017-04-09Merge pull request #1469 from centricular/install-secondary-outputsJussi Pakkanen1-2/+2
Support multiple install dirs for built/custom targets
2017-04-09gnome: Allow modules to optionally generate ObjectManager boilerplateRichard Hughes1-0/+2
Fixes: https://github.com/mesonbuild/meson/issues/1539
2017-04-04Support multiple install dirs for built/custom targetsNirbheek Chauhan1-2/+2
You can now pass a list of strings to the install_dir: kwarg to build_target and custom_target. Custom Targets: =============== Allows you to specify the installation directory for each corresponding output. For example: custom_target('different-install-dirs', output : ['first.file', 'second.file'], ... install : true, install_dir : ['somedir', 'otherdir]) This would install first.file to somedir and second.file to otherdir. If only one install_dir is provided, all outputs are installed there (same behaviour as before). To only install some outputs, pass `false` for the outputs that you don't want installed. For example: custom_target('only-install-second', output : ['first.file', 'second.file'], ... install : true, install_dir : [false, 'otherdir]) This would install second.file to otherdir and not install first.file. Build Targets: ============== With build_target() (which includes executable(), library(), etc), usually there is only one primary output. However some types of targets have multiple outputs. For example, while generating Vala libraries, valac also generates a header and a .vapi file both of which often need to be installed. This allows you to specify installation directories for those too. # This will only install the library (same as before) shared_library('somevalalib', 'somesource.vala', ... install : true) # This will install the library, the header, and the vapi into the # respective directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : ['libdir', 'incdir', 'vapidir']) # This will install the library into the default libdir and # everything else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [true, 'incdir', 'vapidir']) # This will NOT install the library, and will install everything # else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [false, 'incdir', 'vapidir']) true/false can also be used for secondary outputs in the same way. Valac can also generate a GIR file for libraries when the `vala_gir:` keyword argument is passed to library(). In that case, `install_dir:` must be given a list with four elements, one for each output. Includes tests for all these. Closes https://github.com/mesonbuild/meson/issues/705 Closes https://github.com/mesonbuild/meson/issues/891 Closes https://github.com/mesonbuild/meson/issues/892 Closes https://github.com/mesonbuild/meson/issues/1178 Closes https://github.com/mesonbuild/meson/issues/1193
2017-04-03gnome: Preserve ordering of flags passed to toolsSam Thursfield1-5/+5
This avoids unnecessary rebuilds occuring when Meson regenerates the build.ninja file. Previously, if the ordering of the commandline arguments changed then Ninja would consider the outputs dirty and rebuild them.
2017-03-28modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@Nirbheek Chauhan1-8/+6
First step in fixing https://github.com/mesonbuild/meson/issues/1419 Also works around an issue in the MinGW windres.exe that causes it to fail if any of the arguments passed to it contain a space. There seems to be no way to quote or escape the spaces in the path to make windres parse the path correctly, so we just warn about it instead. https://sourceware.org/bugzilla/show_bug.cgi?id=4933 https://github.com/mesonbuild/meson/pull/1346
2017-03-21gnome.gdbus_codegen: Use --output-directory when availablePatrick Griffis1-1/+17
Fixes #1387
2017-03-20gnome: fix genmarshal .c file generationTim-Philipp Müller1-1/+1
The .c file shouldn't contain the header bits as well.
2017-03-03gnome.genmarshal: Use --output when availablePatrick Griffis1-1/+7
This is just cleaner and works around #1417
2017-02-26gnome: Pass ExternalProgram objects to CustomTargetNirbheek Chauhan1-7/+7
There is no need to do obj.get_command() and in fact it's wrong because the VS backends need to resolve each object to absolute paths and get_command() does not do that. This should fix invocation of GNOME module helpers with the VS backends For the record, absolute paths for programs are needed because the same PATH environment won't necessarily be available to Visual Studio when it builds the generated solution. Related to https://github.com/mesonbuild/meson/issues/1419
2017-02-26Raise if gobject-introspection is not found.Elliott Sales de Andrade1-5/+1
This used to produce a warning, but then would crash anyway. It's simpler if we just error out and have the user disable gir generation or install gobject-introspection.
2017-02-20Merge pull request #1403 from centricular/compile_resourcesJussi Pakkanen1-4/+19
Make configure_file() great again
2017-02-20gnome: Support configure_file() output in compile_resourcesNirbheek Chauhan1-3/+10
We can't support generated XML files with custom_target() because the dependency scanning happens at configure time, but we *can* support generating them with configure_file(). Closes https://github.com/mesonbuild/meson/issues/1380
2017-02-20gnome: Document why we need absolute paths for mkenumsNirbheek Chauhan1-0/+1
I forgot why this was needed and had to dig through the git logs. Link to the GitHub issue for future reference.
2017-02-20gnome: Print an error message when generated files are passed to ↵Nirbheek Chauhan1-1/+8
compile_resources
2017-02-19gnome: Fix minimum gresource dependency requiredNirbheek Chauhan1-1/+1
This is the latest release of glib that exists and has the required dependency-generation fixes. Without this GNOME Recipes cannot even configure.
2017-02-19gnome: Only check gresource version with CustomTargetsNirbheek Chauhan1-17/+20
We don't need dependencies to work correctly to use the output of configure_file in the dependencies: kwarg. This allows GNOME Recipes to built without the latest glib git.
2017-02-09gnome: Do not use gir specific `--extra-lib` to generate gtkdoc argsThibault Saunier1-8/+14
Fixes 1372
2017-01-11style: [E303] too many blank lines (2)Mike Sinkovsky1-1/+0
2017-01-09There are two different kinds of extensions: modules that create newJussi Pakkanen1-1/+2
objects directly and snippets that just call into interpreter methods.
2017-01-09Fix Gnome module.Jussi Pakkanen1-16/+24
2017-01-02style: fix E127 violationsIgor Gnatenko1-8/+7
E127: continuation line over-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>