From c2e6565029779b749dc3423291524115af1b2bd7 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Sun, 10 Nov 2019 09:26:55 -0500 Subject: add meson.get_native_property for native files This allows Meson native-file [properties] to be used. This avoids the need to call meson from a script file or have a long command line invocation of `meson setup` The method meson.get_native_property('prop', 'fallback') is added. The native file can contain properties like ``` [properties] myprop1 = 'foo' mydir2 = 'lib/custom' ``` Then from within `meson.build` ```meson x1 = meson.get_native_property('myprop1') thedir = meson.get_native_property('mydir2', 'libs') ``` fallback values are optional --- docs/markdown/snippets/native_property.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/markdown/snippets/native_property.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/native_property.md b/docs/markdown/snippets/native_property.md new file mode 100644 index 0000000..6c49e80 --- /dev/null +++ b/docs/markdown/snippets/native_property.md @@ -0,0 +1,16 @@ +## Native file properties + +As of Meson 0.53.0, the `--native-file foo.txt` can contain: + +* binaries +* paths +* properties + +which are defined and used the same way as in cross files. +The `properties` are new for Meson 0.53.0, and are read like: + +```meson +x = meson.get_native_property('foobar', 'foo') +``` + +where `foobar` is the property name, and the optional `foo` is the fallback string value. \ No newline at end of file -- cgit v1.1 From 554d35c3f3eb8710d1a265dccd173cbf653258bf Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Wed, 13 Nov 2019 16:05:00 -0500 Subject: add get_external_property to replace get_cross_property --- docs/markdown/snippets/native_property.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/native_property.md b/docs/markdown/snippets/native_property.md index 6c49e80..3845fa1 100644 --- a/docs/markdown/snippets/native_property.md +++ b/docs/markdown/snippets/native_property.md @@ -1,6 +1,6 @@ ## Native file properties -As of Meson 0.53.0, the `--native-file foo.txt` can contain: +As of Meson 0.53.0, the `--native-file nativefile.ini` can contain: * binaries * paths @@ -10,7 +10,9 @@ which are defined and used the same way as in cross files. The `properties` are new for Meson 0.53.0, and are read like: ```meson -x = meson.get_native_property('foobar', 'foo') +x = meson.get_external_property('foobar', 'foo') ``` -where `foobar` is the property name, and the optional `foo` is the fallback string value. \ No newline at end of file +where `foobar` is the property name, and the optional `foo` is the fallback string value. + +For cross-compiled projects, `get_external_property()` reads the cross-file unless `native: true` is specified. \ No newline at end of file -- cgit v1.1 From a4e4d2e75a25d4254e13ce0d6e3486f87e2d027a Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Wed, 5 Feb 2020 13:26:35 -0500 Subject: doc --- docs/markdown/snippets/native_property.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/native_property.md b/docs/markdown/snippets/native_property.md index 3845fa1..d3808d8 100644 --- a/docs/markdown/snippets/native_property.md +++ b/docs/markdown/snippets/native_property.md @@ -1,13 +1,13 @@ ## Native file properties -As of Meson 0.53.0, the `--native-file nativefile.ini` can contain: +As of Meson 0.54.0, the `--native-file nativefile.ini` can contain: * binaries * paths * properties which are defined and used the same way as in cross files. -The `properties` are new for Meson 0.53.0, and are read like: +The `properties` are new for Meson 0.54.0, and are read like: ```meson x = meson.get_external_property('foobar', 'foo') -- cgit v1.1