mirror of
https://github.com/herumi/xbyak
synced 2024-11-20 16:06:14 -07:00
c7c1eac070
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.
48 lines
1.3 KiB
Meson
48 lines
1.3 KiB
Meson
# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
|
|
#
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
project(
|
|
'xbyak',
|
|
'cpp',
|
|
version: '7.05.1',
|
|
license: 'BSD-3-Clause',
|
|
default_options: 'b_ndebug=if-release'
|
|
)
|
|
|
|
include_dir = get_option('prefix') / get_option('includedir')
|
|
install_subdir('xbyak', install_dir: include_dir)
|
|
|
|
xbyak_dep = declare_dependency(include_directories: include_directories('.'))
|
|
|
|
if meson.version().version_compare('>=0.54.0')
|
|
meson.override_dependency(meson.project_name(), xbyak_dep)
|
|
endif
|
|
|
|
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',
|
|
variables: ['includedir=@0@'.format(include_dir)],
|
|
dataonly: true,
|
|
)
|
|
|
|
if meson.version().version_compare('>=0.50.0')
|
|
cmake = import('cmake')
|
|
|
|
cmake.write_basic_package_version_file(
|
|
name: meson.project_name(),
|
|
version: meson.project_version()
|
|
)
|
|
|
|
cmake_conf = configuration_data()
|
|
cmake_conf.set('TARGET_NAME', meson.project_name() + '::' + meson.project_name())
|
|
cmake_conf.set('ABSOLUTE_INCLUDE_DIR', get_option('prefix')/get_option('includedir'))
|
|
|
|
cmake.configure_package_config_file(
|
|
name: meson.project_name(),
|
|
input: 'cmake'/'meson-config.cmake.in',
|
|
configuration: cmake_conf
|
|
)
|
|
endif
|