xbyak/meson.build
Andrea Pappacoda 6c593b9a10
build(meson): arch-independent fixes
This patch fixes a couple of issues introduced in commits
c7c1eac070 and
9f53572915:

- Dropped `dataonly: true` from `pkgconfig.generate()`, since it
  generates a .pc file unsuitable for libraries. Instead, I've just set
  `install_dir` to `$datadir/pkgconfig`, which generates the following:

      $ cat /usr/share/pkgconfig/xbyak.pc
      prefix=/usr
      includedir=${prefix}/include

      Name: xbyak
      Description: JIT assembler for x86(IA32), x64(AMD64, x86-64)
      URL: https://github.com/herumi/xbyak
      Version: 7.06
      Cflags: -I${includedir}

- Changed `share/cmake/xbyak` to
  `get_option('datadir')/'cmake'/meson.project_name()` to avoid
  hardcoding "share" as the datadir.

- Added `arch_independent: true` to the
  `cmake.write_basic_package_version_file()` call so that the generated
  CMake version file doesn't contain arch-specific checks unsuitable for
  a file located in /usr/share/cmake.
2024-03-09 21:51:48 +01:00

50 lines
1.4 KiB
Meson

# SPDX-FileCopyrightText: 2021 Andrea Pappacoda
#
# SPDX-License-Identifier: BSD-3-Clause
project(
'xbyak',
'cpp',
version: '7.06',
license: 'BSD-3-Clause',
default_options: 'b_ndebug=if-release'
)
install_subdir('xbyak', install_dir: get_option('includedir'))
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',
install_dir: get_option('datadir')/'pkgconfig'
)
if meson.version().version_compare('>=0.62.0')
cmake = import('cmake')
shared_cmake_dir = get_option('datadir')/'cmake'/meson.project_name()
cmake.write_basic_package_version_file(
name: meson.project_name(),
version: meson.project_version(),
install_dir: shared_cmake_dir,
arch_independent: true
)
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,
install_dir: shared_cmake_dir,
)
endif