summaryrefslogtreecommitdiffstats
path: root/contrib/meson/lib/meson.build
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2019-01-23 08:40:26 (GMT)
committerLzu Tao <taolzu@gmail.com>2019-01-23 08:40:26 (GMT)
commit929dbbcddf780882d9f6b4175a533712379ffeb2 (patch)
tree96350cf7f53985a938f6eb88f61cd5051b9e04c9 /contrib/meson/lib/meson.build
parent6305e43dce0c8f0049167a41f92973fc1ef8a624 (diff)
downloadlz4-929dbbcddf780882d9f6b4175a533712379ffeb2.zip
lz4-929dbbcddf780882d9f6b4175a533712379ffeb2.tar.gz
lz4-929dbbcddf780882d9f6b4175a533712379ffeb2.tar.bz2
meson: Add -DLZ4_DLL_EXPORT=1 to build dynamic lib on Windows
Thanks @nacho for pointing it out.
Diffstat (limited to 'contrib/meson/lib/meson.build')
-rw-r--r--contrib/meson/lib/meson.build7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/meson/lib/meson.build b/contrib/meson/lib/meson.build
index f1deb58..e782334 100644
--- a/contrib/meson/lib/meson.build
+++ b/contrib/meson/lib/meson.build
@@ -27,6 +27,10 @@ if use_debug
endif
liblz4_c_args += cc.get_supported_arguments(liblz4_debug_cflags)
+if host_machine_os == os_windows and default_library != 'static'
+ liblz4_c_args += '-DLZ4_DLL_EXPORT=1'
+endif
+
liblz4 = library('lz4',
liblz4_sources,
include_directories: liblz4_includes,
@@ -47,6 +51,7 @@ pkgconfig.generate(liblz4,
install_headers(join_paths(lz4_root_dir, 'lib/lz4.h'),
join_paths(lz4_root_dir, 'lib/lz4hc.h'),
join_paths(lz4_root_dir, 'lib/lz4frame.h'))
-if get_option('default_library') != 'shared'
+
+if default_library != 'shared'
install_headers(join_paths(lz4_root_dir, 'lib/lz4frame_static.h'))
endif