diff options
Diffstat (limited to 'contrib/meson/meson.build')
-rw-r--r-- | contrib/meson/meson.build | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/contrib/meson/meson.build b/contrib/meson/meson.build index 3c39034..0047444 100644 --- a/contrib/meson/meson.build +++ b/contrib/meson/meson.build @@ -17,6 +17,7 @@ project('lz4', ['c'], cc = meson.get_compiler('c') pkgconfig = import('pkgconfig') python3 = import('python').find_installation() +c_std = get_option('c_std') host_machine_os = host_machine.system() os_windows = 'windows' @@ -31,26 +32,30 @@ compiler_clang = 'clang' compiler_msvc = 'msvc' lz4_version = meson.project_version() -lz4_libversion = '' -c_std = get_option('c_std') +lz4_h_file = join_paths(meson.current_source_dir(), 'lib/lz4.h') +GetLz4LibraryVersion_py = files('GetLz4LibraryVersion.py') +r = run_command(python3, GetLz4LibraryVersion_py, lz4_h_file) +if r.returncode() == 0 + output = r.stdout().strip() + if output.version_compare('>@0@'.format(lz4_version)) + lz4_version = output + message('Project version is now: @0@'.format(lz4_version)) + endif +endif + +lz4_version_array = lz4_version.split('.') +lz4_libversion = lz4_version +lz4_libsoversion = lz4_version_array[0] # ============================================================================= # Installation directories # ============================================================================= -if host_machine_os == os_windows - lz4_prefix = '.' - lz4_bindir = 'bin' - lz4_datadir = 'share' - lz4_mandir = join_paths(lz4_datadir, 'man') -else - lz4_prefix = get_option('prefix') - lz4_bindir = join_paths(lz4_prefix, get_option('bindir')) - lz4_datadir = join_paths(lz4_prefix, get_option('datadir')) - lz4_mandir = join_paths(lz4_prefix, get_option('mandir')) -endif - +lz4_prefix = get_option('prefix') +lz4_bindir = join_paths(lz4_prefix, get_option('bindir')) +lz4_datadir = join_paths(lz4_prefix, get_option('datadir')) +lz4_mandir = join_paths(lz4_prefix, get_option('mandir')) lz4_docdir = join_paths(lz4_datadir, 'doc', meson.project_name()) # ============================================================================= @@ -73,30 +78,6 @@ build_examples = get_option('build_examples') #feature_multi_thread = get_option('multi_thread') # ============================================================================= -# Helper scripts for Meson -# ============================================================================= - -GetLz4LibraryVersion_py = files('GetLz4LibraryVersion.py') - -# ============================================================================= -# Getting project version from lz4.h -# ============================================================================= - -lz4_h_file = join_paths(meson.current_source_dir(), 'lib/lz4.h') -r = run_command(python3, GetLz4LibraryVersion_py, lz4_h_file) -if r.returncode() == 0 - output = r.stdout().strip() - if output.version_compare('>@0@'.format(lz4_version)) - lz4_version = output - message('Project version is now: @0@'.format(lz4_version)) - endif -endif - -if host_machine_os != os_windows - lz4_libversion = lz4_version -endif - -# ============================================================================= # Dependencies # ============================================================================= |