From d7d948db0d9b8801afdde4f8867e4e3b94363af2 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 3 Jul 2018 23:28:38 +0300 Subject: Update documentation for symbol visibility. --- docs/markdown/Reference-manual.md | 16 ++++++++++++---- docs/markdown/snippets/visibility.md | 13 +++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 docs/markdown/snippets/visibility.md (limited to 'docs') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 12018fc..d14f639 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -511,6 +511,13 @@ be passed to [shared and static libraries](#library). - `override_options` takes an array of strings in the same format as `project`'s `default_options` overriding the values of these options for this target only, since 0.40.0 +- `symbol_visibility` specifies how symbols should be exported, see + e.g [the GCC Wiki](https://gcc.gnu.org/wiki/Visibility) for more + information. This value can either be an empty string or one of + `default`, `internal`, `hidden`, `protected` or `inlineshidden`, which + is the same as `hidden` but also includes things like C++ implicit + constructors as specified in the GCC manual. Available since + 0.48.0. - `d_import_dirs` list of directories to look in for string imports used in the D programming language - `d_unittest`, when set to true, the D modules are compiled in debug mode @@ -976,15 +983,16 @@ dropped. That means that `join_paths('foo', '/bar')` returns `/bar`. buildtarget library(library_name, list_of_sources, ...) ``` -Builds a library that is either static, shared or both depending on the value of -`default_library` user option. You should use this instead of -[`shared_library`](#shared_library), +Builds a library that is either static, shared or both depending on +the value of `default_library` user option. You should use this +instead of [`shared_library`](#shared_library), [`static_library`](#static_library) or [`both_libraries`](#both_libraries) most of the time. This allows you to toggle your entire project (including subprojects) from shared to static with only one option. -The keyword arguments for this are the same as for [`executable`](#executable) with the following additions: +The keyword arguments for this are the same as for +[`executable`](#executable) with the following additions: - `name_prefix` the string that will be used as the prefix for the target output filename by overriding the default (only used for diff --git a/docs/markdown/snippets/visibility.md b/docs/markdown/snippets/visibility.md new file mode 100644 index 0000000..f55a48f --- /dev/null +++ b/docs/markdown/snippets/visibility.md @@ -0,0 +1,13 @@ +## Keyword argument for symbol visibility + +Build targets got a new keyword, `symbol_visibility` that controls how +symbols are exported from shared libraries. This is most commonly used +to hide implementation symbols like this: + +```meson +shared_library('mylib', ... + symbol_visibility: 'hidden') +``` + +In this case only symbols explicitly marked as visible in the source +files get exported. -- cgit v1.1 From fb2cdd0fe2797b30e1fd4c118407302402739a3b Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 9 Aug 2018 19:46:45 +0300 Subject: Call it gnu_symbol_visibility instead. --- docs/markdown/Reference-manual.md | 6 +++--- docs/markdown/snippets/visibility.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index d14f639..a7b8a2b 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -511,13 +511,13 @@ be passed to [shared and static libraries](#library). - `override_options` takes an array of strings in the same format as `project`'s `default_options` overriding the values of these options for this target only, since 0.40.0 -- `symbol_visibility` specifies how symbols should be exported, see +- `gnu_symbol_visibility` specifies how symbols should be exported, see e.g [the GCC Wiki](https://gcc.gnu.org/wiki/Visibility) for more information. This value can either be an empty string or one of `default`, `internal`, `hidden`, `protected` or `inlineshidden`, which is the same as `hidden` but also includes things like C++ implicit - constructors as specified in the GCC manual. Available since - 0.48.0. + constructors as specified in the GCC manual. Ignored on compilers that + do not support GNU visibility arguments. Available since 0.48.0. - `d_import_dirs` list of directories to look in for string imports used in the D programming language - `d_unittest`, when set to true, the D modules are compiled in debug mode diff --git a/docs/markdown/snippets/visibility.md b/docs/markdown/snippets/visibility.md index f55a48f..4b67105 100644 --- a/docs/markdown/snippets/visibility.md +++ b/docs/markdown/snippets/visibility.md @@ -1,4 +1,4 @@ -## Keyword argument for symbol visibility +## Keyword argument for GNU symbol visibility Build targets got a new keyword, `symbol_visibility` that controls how symbols are exported from shared libraries. This is most commonly used @@ -6,7 +6,7 @@ to hide implementation symbols like this: ```meson shared_library('mylib', ... - symbol_visibility: 'hidden') + gnu_symbol_visibility: 'hidden') ``` In this case only symbols explicitly marked as visible in the source -- cgit v1.1