Merge pull request #2668 from rossburton/meson

meson: add hb-version.h to dependencies correctly
This commit is contained in:
Khaled Hosny 2020-09-08 15:37:30 +02:00 committed by GitHub
commit ee12c078ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -4,15 +4,15 @@
import os, sys, shutil import os, sys, shutil
if len (sys.argv) < 5: if len (sys.argv) < 4:
sys.exit(__doc__) sys.exit(__doc__)
version = sys.argv[1] version = sys.argv[1]
major, minor, micro = version.split (".") major, minor, micro = version.split (".")
OUTPUT = sys.argv[2] OUTPUT = sys.argv[2]
CURRENT_SOURCE_DIR = sys.argv[3] INPUT = sys.argv[3]
INPUT = sys.argv[4] CURRENT_SOURCE_DIR = os.path.dirname(INPUT)
with open (INPUT, "r", encoding='utf-8') as template: with open (INPUT, "r", encoding='utf-8') as template:
with open (OUTPUT, "wb") as output: with open (OUTPUT, "wb") as output:

View File

@ -1,3 +1,10 @@
hb_version_h = configure_file(
command: [find_program('gen-hb-version.py'), meson.project_version(), '@OUTPUT@', '@INPUT@'],
input: 'hb-version.h.in',
output: 'hb-version.h',
install: true,
install_dir: join_paths(get_option('includedir'), meson.project_name()))
# Base and default-included sources and headers # Base and default-included sources and headers
hb_base_sources = files( hb_base_sources = files(
'hb-aat-layout-ankr-table.hh', 'hb-aat-layout-ankr-table.hh',
@ -214,9 +221,9 @@ hb_base_headers = files(
'hb-shape.h', 'hb-shape.h',
'hb-style.h', 'hb-style.h',
'hb-unicode.h', 'hb-unicode.h',
'hb-version.h',
'hb.h', 'hb.h',
) )
hb_base_headers += hb_version_h
# Optional Sources and Headers with external deps # Optional Sources and Headers with external deps
@ -281,14 +288,6 @@ hb_gobject_headers = files(
'hb-gobject-structs.h', 'hb-gobject-structs.h',
) )
custom_target('hb-version.h',
build_by_default: true,
input: 'hb-version.h.in',
output: 'hb-version.h',
command: [find_program('gen-hb-version.py'), meson.project_version(),
'@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
ragel = find_program('ragel', required: false) ragel = find_program('ragel', required: false)
if not ragel.found() if not ragel.found()
warning('You have to install ragel if you are going to develop HarfBuzz itself') warning('You have to install ragel if you are going to develop HarfBuzz itself')