diff options
-rw-r--r-- | docs/markdown/Gnome-module.md | 4 | ||||
-rw-r--r-- | docs/markdown/Reference-manual.md | 9 | ||||
-rw-r--r-- | mesonbuild/mesonlib.py | 9 | ||||
-rw-r--r-- | test cases/common/64 custom header generator/meson.build | 6 |
4 files changed, 17 insertions, 11 deletions
diff --git a/docs/markdown/Gnome-module.md b/docs/markdown/Gnome-module.md index fbf9530..ad3715e 100644 --- a/docs/markdown/Gnome-module.md +++ b/docs/markdown/Gnome-module.md @@ -123,7 +123,9 @@ Returns an array of two elements which are: `[c_source, header_file]` ### gnome.mkenums() Generates enum files for GObject using the `glib-mkenums` tool. The -first argument is the base name of the output files. +first argument is the base name of the output files, unless `c_template` +and `h_template` are specified. In this case, the output files will be +the base name of the values passed as templates. This method is essentially a wrapper around the `glib-mkenums` tool's command line API. It is the most featureful method for enum creation. diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 5b22fec..8798a3a 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -435,7 +435,7 @@ be passed to [shared and static libraries](#library). - `install_dir` override install directory for this file. The value is relative to the `prefix` specified. F.ex, if you want to install plugins into a subdir, you'd use something like this: `install_dir : - get_option('libdir') + '/projectname-1.0'`. + join_paths(get_option('libdir'), 'projectname-1.0'`). - `install_rpath` a string to set the target's rpath to after install (but *not* before that) - `objects` list of prebuilt object files (usually for third party @@ -615,8 +615,13 @@ Obtains the value of the [project build option](Build-options.md) specified in t Note that the value returned for built-in options that end in `dir` such as `bindir` and `libdir` is always a path relative to (and inside) the `prefix`. + The only exceptions are: `sysconfdir`, `localstatedir`, and `sharedstatedir` -which will return the value passed during configuration as-is. +which will return the value passed during configuration as-is, which may be +absolute, or relative to `prefix`. [`install_dir` arguments](Installing.md) +handles that as expected, but if you need the absolute path to one of these +e.g. to use in a define etc., you should use `join_paths(get_option('prefix'), +get_option('localstatedir')))` ### get_variable() diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 9e0508b..4e72600 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -36,12 +36,11 @@ def detect_meson_py_location(): # $ <mesontool> <args> (gets run from /usr/bin/<mesontool>) in_path_exe = shutil.which(c_fname) if in_path_exe: - m_dir, c_fname = os.path.split(in_path_exe) - # Special case: when run like "./meson.py <opts>", - # we need to expand it out, because, for example, - # "ninja test" will be run from a different directory. - if m_dir == '.': + if not os.path.isabs(in_path_exe): m_dir = os.getcwd() + c_fname = in_path_exe + else: + m_dir, c_fname = os.path.split(in_path_exe) else: m_dir = os.path.abspath(c_dir) diff --git a/test cases/common/64 custom header generator/meson.build b/test cases/common/64 custom header generator/meson.build index bcc9a53..33ba4c5 100644 --- a/test cases/common/64 custom header generator/meson.build +++ b/test cases/common/64 custom header generator/meson.build @@ -3,9 +3,9 @@ project('custom header generator', 'c') gen = find_program('makeheader.py') generated_h = custom_target('makeheader.py', -output : 'myheader.lh', # Suffix not .h to ensure this works with custom suffixes, too. -input : 'input.def', -command : [gen, '@INPUT0@', '@OUTPUT0@', files('somefile.txt')]) + output : 'myheader.lh', # Suffix not .h to ensure this works with custom suffixes, too. + input : 'input.def', + command : [gen, '@INPUT0@', '@OUTPUT0@', files('somefile.txt')]) prog = executable('prog', 'prog.c', generated_h) test('gentest', prog) |