diff options
author | Andrea Pappacoda <andrea@pappacoda.it> | 2022-02-01 17:39:46 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-02-01 23:48:17 -0500 |
commit | 316cf3a717744bd849a04de4a1625c06779f90a9 (patch) | |
tree | 75af043c065069309b03e9cc7b494ba8fb7c6b34 /docs | |
parent | a755750caefad4ba04b4d9c0d0ad0fbf356349a2 (diff) | |
download | meson-316cf3a717744bd849a04de4a1625c06779f90a9.zip meson-316cf3a717744bd849a04de4a1625c06779f90a9.tar.gz meson-316cf3a717744bd849a04de4a1625c06779f90a9.tar.bz2 |
cmake: add arch_independent kwarg
CMake's write_basic_package_version_file has supported since version 3.14
an ARCH_INDEPENDENT option that makes it skip its architecture check in
the Version file.
With this patch Meson now supports it as well, and the change is also
compatible with older CMake versions, as they will simply ignore the
option.
This also slightly changes the contents of the generated Version file
when arch_independent is not set: previously, the if() needed to skip
the arch check was always filled with an empty string, while CMake puts
"FALSE" (or "TRUE") in it. Now, that if() will always be filled with
either "False" or "True", better matching CMake's behaviour.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/CMake-module.md | 4 | ||||
-rw-r--r-- | docs/markdown/snippets/cmake_version_file_arch.md | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/markdown/CMake-module.md b/docs/markdown/CMake-module.md index 38b6eea..8e6c4e9 100644 --- a/docs/markdown/CMake-module.md +++ b/docs/markdown/CMake-module.md @@ -226,7 +226,7 @@ specification](Machine-files.md). ### cmake.write_basic_package_version_file() This function is the equivalent of the corresponding [CMake -function](https://cmake.org/cmake/help/v3.11/module/CMakePackageConfigHelpers.html#generating-a-package-version-file), +function](https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:write_basic_package_version_file), it generates a `name` package version file. * `name`: the name of the package. @@ -235,6 +235,8 @@ it generates a `name` package version file. `AnyNewerVersion`, `SameMajorVersion`, `SameMinorVersion` or `ExactVersion`. It defaults to `AnyNewerVersion`. Depending on your cmake installation some kind of compatibility may not be available. +* `arch_independent`: *new in 0.62.0*, if true the generated package file + will skip architecture checks. Useful for header-only libraries. * `install_dir`: optional installation directory, it defaults to `$(libdir)/cmake/$(name)` diff --git a/docs/markdown/snippets/cmake_version_file_arch.md b/docs/markdown/snippets/cmake_version_file_arch.md new file mode 100644 index 0000000..b85798e --- /dev/null +++ b/docs/markdown/snippets/cmake_version_file_arch.md @@ -0,0 +1,7 @@ +## arch_independent kwarg in cmake.write_basic_package_version_file + +The `write_basic_package_version_file()` function from the `cmake` module +now supports an `arch_independent` kwarg, so that architecture checks in +the generated Package Version file are skipped, reproducing the behaviour of +CMake's [ARCH_INDEPENDENT](https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:write_basic_package_version_file) +option. |