aboutsummaryrefslogtreecommitdiffhomepage
path: root/meson.build
diff options
context:
space:
mode:
authorZbigniew JÄ™drzejewski-Szmek <[email protected]>2024-03-06 17:48:12 +0100
committerZbigniew JÄ™drzejewski-Szmek <[email protected]>2024-03-06 17:48:12 +0100
commitc7c1eac070851068d7adc3a67ad2efd196145687 (patch)
tree8310c286d8fa6992ab6571f8b5c37181663f8097 /meson.build
parent9c0f5d3ecb06d2c93c2b59becb9b3b763213e74e (diff)
downloadxbyak-c7c1eac070851068d7adc3a67ad2efd196145687.tar.gz
xbyak-c7c1eac070851068d7adc3a67ad2efd196145687.zip
Make xbyak.py installation location arch-independent
I was investigating an issue with the Fedora package build: builds on i686 would yield a package with /usr/lib/pkgconfig/xbyak.pc, while builds on amd64 would yield a package with /usr/lib64/pkgconfig/xbyak.pc. xbyak is arch-indepdent, in the sense of the installed payload being identical on all architectures and located in a non-arch-specific directory (/usr/inlude). The .pc file should be arch-independent too. Right now, if we install the package from a different architecture, we would find the files in /usr/include, but not the .pc file. (E.g. on amd64 the pkg-config search path is /usr/lib64/pkgconfig:/usr/share/pkgconfig, so /usr/lib/pkgconfig/xbyak.pc will not be found.) So install the file to $prefix/pkgconfig (usually /usr/share/pkgconfig) so it will be found properly. We need to specify 'includedir' in the variable list for pkgconfig.generate(), because by default meson does not include this variable when dataonly:true is used. The $prefix/include pattern is evaluated in meson, to handle the case where the user specified an include_dir as absolute path.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build7
1 files changed, 5 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 9e82420..9eb6794 100644
--- a/meson.build
+++ b/meson.build
@@ -10,7 +10,8 @@ project(
default_options: 'b_ndebug=if-release'
)
-install_subdir('xbyak', install_dir: get_option('includedir'))
+include_dir = get_option('prefix') / get_option('includedir')
+install_subdir('xbyak', install_dir: include_dir)
xbyak_dep = declare_dependency(include_directories: include_directories('.'))
@@ -22,7 +23,9 @@ import('pkgconfig').generate(
name: meson.project_name(),
description: 'JIT assembler for x86(IA32), x64(AMD64, x86-64)',
version: meson.project_version(),
- url: 'https://github.com/herumi/xbyak'
+ url: 'https://github.com/herumi/xbyak',
+ variables: ['includedir=@0@'.format(include_dir)],
+ dataonly: true,
)
if meson.version().version_compare('>=0.50.0')