diff --git a/README.md b/README.md index 0274f39..fc3c111 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Graphene -### A thin layer of types for graphic libraries + +### A thin layer of types for graphic libraries ![Linux Build](https://github.com/ebassi/graphene/workflows/Ubuntu%20Build/badge.svg) ![MSVC Build](https://github.com/ebassi/graphene/workflows/MSVC%20Build/badge.svg) ![MSYS2 Build](https://github.com/ebassi/graphene/workflows/MSYS2%20Build/badge.svg) -[![Coverage Status](https://coveralls.io/repos/github/ebassi/graphene/badge.svg?branch=master)](https://coveralls.io/github/ebassi/graphene?branch=master) [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) When creating graphic libraries you most likely end up dealing with points @@ -67,10 +67,10 @@ First of all, clone the Git repository: Then run: - $ meson _build # on Windows, it may be "meson.py" - $ cd _build - $ ninja test - # ninja install + $ meson setup _build + $ meson compile -C _build + $ meson test -C _build + $ meson install -C _build It is possible, when building Graphene, to disable specific optimizations by using configuration options: @@ -120,12 +120,19 @@ Please note that on some MSYS2 installations the Meson binary may be called ## Documentation +### Contributing + +You can follow the [contribution guide](./CONTRIBUTING.md) if you want to +participate in this project. Graphene also has a [code of +conduct](./CODE_OF_CONDUCT.md), so make sure to follow it when interacting +on the project's issue tracker. + ### Release notes The release notes are available on the Graphene [wiki](https://github.com/ebassi/graphene/wiki/Release-Notes). -### Available types +### Reference Graphene provides common types needed to handle 3D transformations: @@ -139,7 +146,7 @@ Graphene provides common types needed to handle 3D transformations: * [vectors](http://ebassi.github.io/graphene/docs/graphene-Vectors.html) (2, 3, or 4-sized) * [matrices](http://ebassi.github.io/graphene/docs/graphene-Matrix.html) * [planes](http://ebassi.github.io/graphene/docs/graphene-Plane.html) - * [axis aligned bounding boxes](http://ebassi.github.io/graphene/docs/graphene-Box.html) + * [3D axis aligned bounding boxes](http://ebassi.github.io/graphene/docs/graphene-Box.html) * [spheres](http://ebassi.github.io/graphene/docs/graphene-Sphere.html) * [frustums](http://ebassi.github.io/graphene/docs/graphene-Frustum.html) @@ -161,4 +168,4 @@ Graphene is released under the terms of the MIT/X11 license. See the [license file](./LICENSE.txt) for more details. [mutest]: https://github.com/ebassi/mutest -[gobject-api]: https://developer.gnome.org/gobject/stable/ +[gobject-api]: https://docs.gtk.org/gobject diff --git a/include/meson.build b/include/meson.build index 8f6cd10..ddbe9ff 100644 --- a/include/meson.build +++ b/include/meson.build @@ -36,7 +36,7 @@ graphene_config_h = configure_file( input: 'graphene-config.h.meson', output: 'graphene-config.h', configuration: graphene_conf, - install_dir: join_paths(graphene_libdir, graphene_api_path, 'include'), + install_dir: graphene_libdir / graphene_api_path / 'include', ) # Version header @@ -50,7 +50,7 @@ configure_file( input: 'graphene-version.h.meson', output: 'graphene-version.h', configuration: version_conf, - install_dir: join_paths(graphene_includedir, graphene_api_path), + install_dir: graphene_includedir / graphene_api_path, ) install_headers( diff --git a/meson.build b/meson.build index d989905..eecd10a 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,13 @@ project('graphene', 'c', - version: '1.11.1', - license: 'MIT', - meson_version: '>= 1.0', - default_options: [ - 'buildtype=debugoptimized', - 'c_std=c99', - 'warning_level=1' - ]) + version: '1.11.1', + license: 'MIT', + meson_version: '>= 1.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=c99', + 'warning_level=1' + ], +) cc = meson.get_compiler('c') host_system = host_machine.system() @@ -44,9 +45,9 @@ darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, revision)] # Paths graphene_prefix = get_option('prefix') -graphene_libdir = join_paths(graphene_prefix, get_option('libdir')) -graphene_includedir = join_paths(graphene_prefix, get_option('includedir')) -graphene_datadir = join_paths(graphene_prefix, get_option('datadir')) +graphene_libdir = graphene_prefix / get_option('libdir') +graphene_includedir = graphene_prefix / get_option('includedir') +graphene_datadir = graphene_prefix / get_option('datadir') graphene_api_path = '@0@-@1@'.format(meson.project_name(), graphene_api_version) @@ -198,11 +199,9 @@ elif get_option('optimization') in ['2', '3', 's'] endif extra_args = [] -# Detect and set symbol visibility -if get_option('default_library') != 'static' - if host_system == 'windows' - conf.set('DLL_EXPORT', true) - endif +# Export DLL symbols on Windows when building a shared library +if get_option('default_library') != 'static' and host_system == 'windows' + conf.set('DLL_EXPORT', true) endif # Optional dependency on GObject @@ -225,14 +224,11 @@ if get_option('gobject_types') endif # Optional dependency on GObject-Introspection; if GObject is disabled -# then we don't build introspection data either -gir = find_program('g-ir-scanner', required : get_option('introspection')) -build_gir = build_gobject and gir.found() -# Disable g-i when cross compiling by default because it rarely works unless -# special care has been taken, in which case the user can enable the option. -if meson.is_cross_build() and not get_option('introspection').enabled() - build_gir = false -endif +# then we don't build introspection data either. +# +# We only build introspection if we can run binaries on the host. +gir = find_program('g-ir-scanner', required: get_option('introspection')) +build_gir = get_option('introspection').allowed() and build_gobject and gir.found() and meson.can_run_host_binaries() # Check for InitOnce on Windows if host_system == 'windows' diff --git a/src/meson.build b/src/meson.build index 6061343..081be2b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -100,7 +100,7 @@ graphene_dep_sources = [] # Introspection if build_gir python = python.find_installation('python3') - identfilter_py = join_paths(meson.current_source_dir(), 'identfilter.py') + identfilter_py = meson.current_source_dir() / 'identfilter.py' gir_extra_args = [ '--identifier-filter-cmd=@0@ "@1@"'.format(python.full_path(), identfilter_py), @@ -122,6 +122,7 @@ if build_gir header: 'graphene-gobject.h', install: true, extra_args: gir_extra_args, + fatal_warnings: get_option('werror'), ) graphene_dep_sources += graphene_gir endif