summaryrefslogtreecommitdiffstats
path: root/contrib/meson
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/meson')
-rw-r--r--contrib/meson/lib/meson.build2
-rw-r--r--contrib/meson/meson.build57
-rw-r--r--contrib/meson/programs/meson.build5
3 files changed, 23 insertions, 41 deletions
diff --git a/contrib/meson/lib/meson.build b/contrib/meson/lib/meson.build
index 7a1b5d5..f4b873e 100644
--- a/contrib/meson/lib/meson.build
+++ b/contrib/meson/lib/meson.build
@@ -33,7 +33,7 @@ liblz4 = library('lz4',
c_args: liblz4_c_args,
install: true,
version: lz4_libversion,
- soversion: '1')
+ soversion: lz4_libsoversion)
liblz4_dep = declare_dependency(link_with: liblz4,
include_directories: liblz4_includes)
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
# =============================================================================
diff --git a/contrib/meson/programs/meson.build b/contrib/meson/programs/meson.build
index b5c3228..2d39b59 100644
--- a/contrib/meson/programs/meson.build
+++ b/contrib/meson/programs/meson.build
@@ -43,9 +43,10 @@ install_man(join_paths(lz4_root_dir, 'programs/lz4.1'))
InstallSymlink_py = '../InstallSymlink.py'
lz4_man1_dir = join_paths(lz4_mandir, 'man1')
-man1_EXT = host_machine_os != os_windows ? '.1.gz' : '.1'
+bin_EXT = host_machine_os == os_windows ? '.exe' : ''
+man1_EXT = '.1.gz' # Meson automatically compresses manpages
foreach f : ['lz4c', 'lz4cat', 'unlz4']
- meson.add_install_script(InstallSymlink_py, 'lz4', f, lz4_bindir)
+ meson.add_install_script(InstallSymlink_py, 'lz4' + bin_EXT, f + bin_EXT, lz4_bindir)
meson.add_install_script(InstallSymlink_py, 'lz4' + man1_EXT, f + man1_EXT, lz4_man1_dir)
endforeach