extlz4 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +21 -3
  4. data/contrib/lz4/CODING_STYLE +57 -0
  5. data/contrib/lz4/LICENSE +1 -1
  6. data/contrib/lz4/Makefile.inc +17 -15
  7. data/contrib/lz4/NEWS +25 -0
  8. data/contrib/lz4/README.md +16 -5
  9. data/contrib/lz4/SECURITY.md +17 -0
  10. data/contrib/lz4/build/README.md +4 -15
  11. data/contrib/lz4/build/VS2022/_build.bat +39 -0
  12. data/contrib/lz4/build/VS2022/_setup.bat +35 -0
  13. data/contrib/lz4/build/VS2022/_test.bat +38 -0
  14. data/contrib/lz4/build/VS2022/build-and-test-win32-debug.bat +26 -0
  15. data/contrib/lz4/build/VS2022/build-and-test-win32-release.bat +26 -0
  16. data/contrib/lz4/build/VS2022/build-and-test-x64-debug.bat +26 -0
  17. data/contrib/lz4/build/VS2022/build-and-test-x64-release.bat +26 -0
  18. data/contrib/lz4/build/VS2022/datagen/datagen.vcxproj +7 -3
  19. data/contrib/lz4/build/{VS2017 → VS2022}/lz4/lz4.vcxproj +21 -7
  20. data/contrib/lz4/build/VS2022/lz4.sln +5 -2
  21. data/contrib/lz4/build/cmake/CMakeLists.txt +95 -100
  22. data/contrib/lz4/build/meson/GetLz4LibraryVersion.py +39 -0
  23. data/contrib/lz4/build/meson/README.md +34 -0
  24. data/contrib/lz4/build/meson/meson/contrib/gen_manual/meson.build +42 -0
  25. data/contrib/lz4/build/meson/meson/contrib/meson.build +11 -0
  26. data/contrib/lz4/build/meson/meson/examples/meson.build +32 -0
  27. data/contrib/lz4/build/meson/meson/lib/meson.build +87 -0
  28. data/contrib/lz4/build/meson/meson/meson.build +135 -0
  29. data/contrib/lz4/build/meson/meson/ossfuzz/meson.build +35 -0
  30. data/contrib/lz4/build/meson/meson/programs/meson.build +91 -0
  31. data/contrib/lz4/build/meson/meson/tests/meson.build +162 -0
  32. data/contrib/lz4/build/meson/meson.build +31 -0
  33. data/contrib/lz4/build/meson/meson_options.txt +44 -0
  34. data/contrib/lz4/build/visual/README.md +5 -0
  35. data/contrib/lz4/build/visual/generate_solution.cmd +55 -0
  36. data/contrib/lz4/build/visual/generate_vs2015.cmd +3 -0
  37. data/contrib/lz4/build/visual/generate_vs2017.cmd +3 -0
  38. data/contrib/lz4/build/visual/generate_vs2019.cmd +3 -0
  39. data/contrib/lz4/build/visual/generate_vs2022.cmd +3 -0
  40. data/contrib/lz4/lib/README.md +25 -1
  41. data/contrib/lz4/lib/lz4.c +206 -99
  42. data/contrib/lz4/lib/lz4.h +111 -69
  43. data/contrib/lz4/lib/lz4file.c +111 -81
  44. data/contrib/lz4/lib/lz4file.h +2 -2
  45. data/contrib/lz4/lib/lz4frame.c +179 -121
  46. data/contrib/lz4/lib/lz4frame.h +162 -103
  47. data/contrib/lz4/lib/lz4hc.c +943 -382
  48. data/contrib/lz4/lib/lz4hc.h +43 -42
  49. data/contrib/lz4/lib/xxhash.c +21 -21
  50. data/contrib/lz4/ossfuzz/decompress_fuzzer.c +1 -1
  51. data/contrib/lz4/ossfuzz/fuzz_helpers.h +1 -1
  52. data/ext/blockapi.c +11 -11
  53. data/ext/frameapi.c +23 -23
  54. metadata +34 -28
  55. data/contrib/lz4/build/VS2010/datagen/datagen.vcxproj +0 -169
  56. data/contrib/lz4/build/VS2010/frametest/frametest.vcxproj +0 -176
  57. data/contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj +0 -176
  58. data/contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -180
  59. data/contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj +0 -173
  60. data/contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj +0 -175
  61. data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.rc +0 -51
  62. data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj +0 -179
  63. data/contrib/lz4/build/VS2010/lz4/lz4.vcxproj +0 -189
  64. data/contrib/lz4/build/VS2010/lz4.sln +0 -98
  65. data/contrib/lz4/build/VS2017/datagen/datagen.vcxproj +0 -173
  66. data/contrib/lz4/build/VS2017/frametest/frametest.vcxproj +0 -180
  67. data/contrib/lz4/build/VS2017/fullbench/fullbench.vcxproj +0 -180
  68. data/contrib/lz4/build/VS2017/fullbench-dll/fullbench-dll.vcxproj +0 -184
  69. data/contrib/lz4/build/VS2017/fuzzer/fuzzer.vcxproj +0 -177
  70. data/contrib/lz4/build/VS2017/liblz4/liblz4.vcxproj +0 -179
  71. data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc +0 -51
  72. data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.vcxproj +0 -183
  73. data/contrib/lz4/build/VS2017/lz4/lz4.rc +0 -51
  74. data/contrib/lz4/build/VS2017/lz4.sln +0 -103
  75. /data/contrib/lz4/build/{VS2010 → VS2022}/lz4/lz4.rc +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 960dfd2d3d26080ed4115e4e5131c510a28f4415054deead1dc4f7563163d43e
4
- data.tar.gz: c421de615b4ad2c71e4e4645f0ca94f3426aadc354350a0365ddd6912c472d10
3
+ metadata.gz: baa3e15848383c3243e7c6d3dc09cc5a7f7094071d7591611cec509159823559
4
+ data.tar.gz: efdedcf6caa86e9710d775a630ae62595b5274db2096821a402681062c32ffe5
5
5
  SHA512:
6
- metadata.gz: 70cde50167bc57e50a63148b9beb3e662007b5d50bfd902108d0de8cd28214a05620b3df7c52e71d01fc3ea73250b78103b93cc625dd9d7a62c3a042f63f85ad
7
- data.tar.gz: df0df6e229d8ee0a5f1f1f4b229fc7558385ea0a8453dc242558946bb7c29ab8e1c84dbf46d745f07afa627456dd5d872e29287c3c63801ead1325088bd28fce
6
+ metadata.gz: f2b53623843be3b007391a21fe722f964f1287cf384de1e56f5d3839cb76e1f38c348c165e703f19a8ddc6467ce47d8f4cddf084ce7cae72df314295815a2ec7
7
+ data.tar.gz: 91fb074e801f634d0637635401dd6ee28c28f1d7400f88a6e92eef28d580c1f8eaa862c9d7c025f8d53ccd4a39957472308200ae23b06f5da1776e0ac08a3fd7
data/README.md CHANGED
@@ -189,7 +189,7 @@ Ruby3 で追加された `Ractor` に対応しています。
189
189
  - author: dearblue (mailto:dearblue@users.osdn.me)
190
190
  - project page: <https://github.com/dearblue/ruby-extlz4>
191
191
  - how to install: `gem install extlz4`
192
- - version: 0.3.4
192
+ - version: 0.3.5
193
193
  - product quality: technical preview
194
194
  - licensing: [2 clause BSD License](LICENSE)
195
195
  - dependency gems: none
data/Rakefile CHANGED
@@ -2,6 +2,8 @@
2
2
  require "pathname"
3
3
  require "rake/clean"
4
4
 
5
+ RUBYSET ||= (ENV["RUBYSET"] || "").split(",").yield_self { |me| me.empty? ? nil : me }
6
+
5
7
  docnames = "{README,LICENSE,CHANGELOG,Changelog,HISTORY}"
6
8
  doctypes = "{,.txt,.rd,.rdoc,.md,.markdown}"
7
9
  cexttypes = "{c,C,cc,cxx,cpp,h,H,hh}"
@@ -69,9 +71,7 @@ desc "build release package"
69
71
  task :release => :all
70
72
 
71
73
  unless EXTCONF.empty?
72
- RUBYSET ||= (ENV["RUBYSET"] || "").split(",")
73
-
74
- if RUBYSET.nil? || RUBYSET.empty?
74
+ if RUBYSET.nil?
75
75
  $stderr.puts <<-EOS
76
76
  #{__FILE__}:
77
77
  |
@@ -143,6 +143,8 @@ ABORTED.
143
143
  desc "build c-extension libraries"
144
144
  task "sofiles" => SOFILES
145
145
 
146
+ task "test" => SOFILES
147
+
146
148
  SOFILES_SET.each do |(ruby, soname, extconf)|
147
149
  sodir = File.dirname(soname)
148
150
  makefile = File.join(sodir, "Makefile")
@@ -184,6 +186,17 @@ task rspec: :all do
184
186
  sh "rspec"
185
187
  end
186
188
 
189
+ desc "test library"
190
+ task "test" do
191
+ (RUBYSET || ["ruby"]).each do |ruby|
192
+ lib = File.join(__dir__, "lib")
193
+ dir2 = __dir__.gsub(/[\[\{\*\?]/) { |m| "\\#{m}" }
194
+ Dir.glob(File.join(dir2, "test/**/test_*.rb")) do |test|
195
+ sh *%W(#{ruby} -I#{lib} #{test})
196
+ end
197
+ end
198
+ end
199
+
187
200
  desc "build gem package"
188
201
  task gem: GEMFILE
189
202
 
@@ -217,6 +230,11 @@ end
217
230
 
218
231
  file BUNDLER_GEMFILE => RAKEFILE do
219
232
  File.write(BUNDLER_GEMFILE, <<~GemfileSource, mode: "wb")
233
+ #
234
+ # This file is auto generated by `rake gemfile`.
235
+ # THE CONTENT YOU CHANGED WILL BE LOST.
236
+ #
237
+
220
238
  source "https://rubygems.org/"
221
239
 
222
240
  group "default" do
@@ -0,0 +1,57 @@
1
+ LZ4 CODING STYLE
2
+ ================
3
+
4
+ When contributing code and patches to the `LZ4` project, the following rules are expected to be followed for a successful merge.
5
+
6
+
7
+ Library
8
+ -------
9
+
10
+ The library's source code in `lib/` directory has a BSD 2-clause license.
11
+ It's designed to be integrated into 3rd party applications.
12
+
13
+ It adheres relatively strictly to vanilla `C90`, with the following exceptions:
14
+ - `long long` type is required, in order to support 64-bit values
15
+ - Variadic Macros are used for debug mode (but not required in release mode)
16
+
17
+ Beyond that, all other rules and limitations of C90 must be respected, including `/* ... */` comment style only, and variable declaration at top of block only. The automated CI test suite will check for these rules.
18
+
19
+ The code is allowed to use more modern variants (C99 / C11 / C23) when useful
20
+ as long as it provides a clean C90 backup for older compilers.
21
+ For example, C99+ compilers will employ the `restrict` keyword, while `C90` ones will ignore it, thanks to conditional macros.
22
+ This ensures maximum portability across a wide range of systems.
23
+
24
+ Moreover, in the interest of safety, the code has to respect a fairly strigent list of additional restrictions, provided through warning flags, the list of which is maintained within `Makefile`.
25
+ Among the less common ones, we want the source to be compatible with `-Wc++-compat`, which ensures that the code can be compiled "as is", with no modification, as C++ code. It makes it possible to copy-paste the code into other C++ source files, or the source files are just dropped into a C++ environment which then compiles them as C++ source files.
26
+
27
+
28
+ Command Line Interface
29
+ ----------------------
30
+
31
+ The CLI executable's source code in `programs/` directory has a GPLv2+ license.
32
+ While it's designed to be portable and freely distributable, it's not meant to be integrated into 3rd party applications.
33
+ The license difference is meant to reflect that choice.
34
+
35
+ Similar to the library, the CLI adheres relatively strictly to vanilla `C90`, and features the same exceptions:
36
+ - `long long` requirement for 64-bit values
37
+ - Variadic Macros for console messages (now used all the time, not just debug mode)
38
+
39
+ The code can also use system-specific libraries and symbols (such as `posix` ones)
40
+ as long as it provides a backup for plain `C90` platforms.
41
+ It's even allowed to lose capabilities, as long as the CLI can be cleanly compiled on `C90`.
42
+ For example, systems without `<pthread>` support nor Completion Ports will just not feature multi-threading support, and run single threaded.
43
+
44
+ In the interest of build familiarity, the CLI source code also respects the same set of advanced warning flags as the library.
45
+ That being said, this last part is debatable and could deviate in the future.
46
+ For example, there are less reasons to support `-Wc++-compat` on the CLI side, since it's not meant to be integrated into 3rd party applications.
47
+
48
+
49
+ Others
50
+ ------
51
+
52
+ The repository includes other directories with their own set of compilable projects, such as `tests/`, `examples/` and `contrib/`.
53
+
54
+ These repositories do not have to respect the same set of restrictions, and can employ a larger array of different languages.
55
+ For example, some tests employ `sh`, and others employ `python`.
56
+
57
+ These directories may nonetheless include several targets employing the same coding convention as the `lz4` library. This is in a no way a rule, more like a side effect of build familiarity.
data/contrib/lz4/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  This repository uses 2 different licenses :
2
2
  - all files in the `lib` directory use a BSD 2-Clause license
3
- - all other files use a GPLv2 license, unless explicitly stated otherwise
3
+ - all other files use a GPL-2.0-or-later license, unless explicitly stated otherwise
4
4
 
5
5
  Relevant license is reminded at the top of each source file,
6
6
  and with presence of COPYING or LICENSE file in associated directories.
@@ -38,26 +38,26 @@ ifeq ($(TARGET_OS),)
38
38
  endif
39
39
 
40
40
  ifneq (,$(filter Windows%,$(TARGET_OS)))
41
- LIBLZ4 = liblz4-$(LIBVER_MAJOR)
42
- LIBLZ4_EXP = liblz4.lib
43
- WINBASED = yes
41
+ LIBLZ4_NAME = liblz4-$(LIBVER_MAJOR)
42
+ LIBLZ4_EXP = liblz4.lib
43
+ WINBASED = yes
44
44
  else
45
- LIBLZ4_EXP = liblz4.dll.a
45
+ LIBLZ4_EXP = liblz4.dll.a
46
46
  ifneq (,$(filter MINGW%,$(TARGET_OS)))
47
- LIBLZ4 = liblz4
48
- WINBASED = yes
47
+ LIBLZ4_NAME = liblz4
48
+ WINBASED = yes
49
49
  else
50
50
  ifneq (,$(filter MSYS%,$(TARGET_OS)))
51
- LIBLZ4 = msys-lz4-$(LIBVER_MAJOR)
52
- WINBASED = yes
51
+ LIBLZ4_NAME = msys-lz4-$(LIBVER_MAJOR)
52
+ WINBASED = yes
53
53
  else
54
54
  ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
55
- LIBLZ4 = cyglz4-$(LIBVER_MAJOR)
56
- WINBASED = yes
55
+ LIBLZ4_NAME = cyglz4-$(LIBVER_MAJOR)
56
+ WINBASED = yes
57
57
  else
58
- LIBLZ4 = liblz4.$(SHARED_EXT_VER)
59
- WINBASED = no
60
- EXT =
58
+ LIBLZ4_NAME = liblz4
59
+ WINBASED = no
60
+ EXT =
61
61
  endif
62
62
  endif
63
63
  endif
@@ -65,9 +65,11 @@ endif
65
65
 
66
66
  ifeq ($(WINBASED),yes)
67
67
  EXT = .exe
68
- WINDRES = windres
68
+ WINDRES ?= windres
69
69
  endif
70
70
 
71
+ LIBLZ4 = $(LIBLZ4_NAME).$(SHARED_EXT_VER)
72
+
71
73
  #determine if dev/nul based on host environment
72
74
  ifneq (,$(filter MINGW% MSYS% CYGWIN%,$(shell $(UNAME))))
73
75
  VOID := /dev/null
@@ -108,4 +110,4 @@ endif
108
110
 
109
111
  INSTALL_PROGRAM ?= $(INSTALL) -m 755
110
112
  INSTALL_DATA ?= $(INSTALL) -m 644
111
- INSTALL_DIR ?= $(INSTALL) -d -m 755
113
+ MAKE_DIR ?= $(INSTALL) -d -m 755
data/contrib/lz4/NEWS CHANGED
@@ -1,3 +1,27 @@
1
+ v1.10.0
2
+ cli : multithreading compression support: improves speed by X times threads allocated
3
+ cli : overlap decompression with i/o, improving speed by ~+60%
4
+ cli : support environment variables LZ4_CLEVEL and LZ4_NBWORKERS
5
+ cli : license of CLI more clearly labelled GPL-2.0-or-later
6
+ cli : fix: refuse to compress directories
7
+ cli : fix dictionary compression benchmark on multiple files
8
+ cli : change: no more implicit `stdout` (except when input is `stdin`)
9
+ lib : new level 2, offering mid-way performance (speed and compression)
10
+ lib : Improved lz4frame compression speed for small data (up to +160% at 1KB)
11
+ lib : Slightly faster (+5%) HC compression speed (levels 3-9), by @JunHe77
12
+ lib : dictionary compression support now in stable status
13
+ lib : lz4frame states can be safely reset and reused after a processing error (described by @QrczakMK)
14
+ lib : `lz4file` API improvements, by @vsolontsov-volant and @t-mat
15
+ lib : new experimental symbol `LZ4_compress_destSize_extState()`
16
+ build: cmake minimum version raised to 3.5
17
+ build: cmake improvements, by @foxeng, @Ohjurot, @LocalSpook, @teo-tsirpanis, @ur4t and @t-mat
18
+ build: meson scripts are now hosted into `build/` directory, by @eli-schwartz
19
+ build: meson improvements, by @tristan957
20
+ build: Visual Studio solutions generated by `cmake` via scripts
21
+ port : support for loongArch, risc-v, m68k, mips and sparc architectures
22
+ port : improved Visual Studio compatibility, by @t-mat
23
+ port : freestanding support improvements, by @t-mat
24
+
1
25
  v1.9.4
2
26
  perf : faster decoding speed (~+20%) on aarch64 platforms
3
27
  perf : faster decoding speed (~+70%) for -BD4 setting in CLI
@@ -9,6 +33,7 @@ api : new experimental function `LZ4F_uncompressedUpdate()`, by @alexmohr
9
33
  cli : `--list` works on `stdin` input, by @Low-power
10
34
  cli : `--no-crc` does not produce (compression) nor check (decompression) checksums
11
35
  cli : fix: `--test` and `--list` produce an error code when parsing invalid input
36
+ cli : fix: `--test -m` does no longer create decompressed file artifacts
12
37
  cli : fix: support skippable frames when passed via `stdin`, reported by @davidmankin
13
38
  build: fix: Makefile respects CFLAGS directives passed via environment variable
14
39
  build: `LZ4_FREESTANDING`, new build macro for freestanding environments, by @t-mat
@@ -26,10 +26,8 @@ LZ4 library is provided as open-source software using BSD 2-Clause license.
26
26
 
27
27
  |Branch |Status |
28
28
  |------------|---------|
29
- |dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] |
29
+ |dev | [![Build status][AppveyorDevBadge]][AppveyorLink] |
30
30
 
31
- [travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
32
- [travisLink]: https://travis-ci.org/lz4/lz4
33
31
  [AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
34
32
  [AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
35
33
 
@@ -62,7 +60,7 @@ in single-thread mode.
62
60
  [zlib]: http://www.zlib.net/
63
61
  [Zstandard]: http://www.zstd.net/
64
62
 
65
- LZ4 is also compatible and optimized for x32 mode,
63
+ LZ4 is also compatible and optimized for x32 mode (`-mx32`),
66
64
  for which it provides additional speed performance.
67
65
 
68
66
 
@@ -91,7 +89,7 @@ You can download and install LZ4 using the [vcpkg](https://github.com/Microsoft/
91
89
  cd vcpkg
92
90
  ./bootstrap-vcpkg.sh
93
91
  ./vcpkg integrate install
94
- vcpkg install lz4
92
+ ./vcpkg.exe install lz4
95
93
 
96
94
  The LZ4 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
97
95
 
@@ -118,3 +116,16 @@ many contributors have created versions of lz4 in multiple languages
118
116
  A list of known source ports is maintained on the [LZ4 Homepage].
119
117
 
120
118
  [LZ4 Homepage]: http://www.lz4.org
119
+
120
+ ### Packaging status
121
+
122
+ Most distributions are bundled with a package manager
123
+ which allows easy installation of both the `liblz4` library
124
+ and the `lz4` command line interface.
125
+
126
+ [![Packaging status](https://repology.org/badge/vertical-allrepos/lz4.svg)](https://repology.org/project/lz4/versions)
127
+
128
+
129
+ ### Special Thanks
130
+
131
+ - Takayuki Matsuoka, aka @t-mat, for exceptional first-class support throughout the lifetime of this project
@@ -0,0 +1,17 @@
1
+ # Security Policy
2
+
3
+ If you have discovered a security vulnerability in this project, please report it
4
+ privately. **Do not disclose it as a public issue.** This gives me time to work with you
5
+ to fix the issue before public exposure, reducing the chance that the exploit will be
6
+ used before a patch is released.
7
+
8
+ Please submit the report by filling out
9
+ [this form](https://github.com/lz4/lz4/security/advisories/new).
10
+
11
+ Please provide the following information in your report:
12
+
13
+ - A description of the vulnerability and its impact
14
+ - How to reproduce the issue
15
+
16
+ This project is maintained by a single maintainer on a reasonable-effort basis. As such,
17
+ I ask that you give me 90 days to work on a fix before public exposure.
@@ -5,23 +5,12 @@ Projects for various integrated development environments (IDE)
5
5
 
6
6
  The following projects are included with the lz4 distribution:
7
7
  - `cmake` - CMake project
8
- - `VS2010` - Visual Studio 2010 project (which also works well with Visual Studio 2012, 2013, 2015)
9
- - `VS2017` - Visual Studio 2017 project
8
+ - `meson` - Meson project
9
+ - `visual` - scripts to generate Visual Studio solutions from `cmake` script
10
+ - `VS2022` - Visual Studio 2022 solution - will soon be deprecated, prefer `visual` generators
10
11
 
11
12
 
12
- #### How to compile lz4 with Visual Studio
13
-
14
- 1. Install Visual Studio e.g. VS 2015 Community Edition (it's free).
15
- 2. Download the latest version of lz4 from https://github.com/lz4/lz4/releases
16
- 3. Decompress ZIP archive.
17
- 4. Go to decompressed directory then to `build` then `VS2010` and open `lz4.sln`
18
- 5. Visual Studio will ask about converting VS2010 project to VS2015 and you should agree.
19
- 6. Change `Debug` to `Release` and if you have 64-bit Windows change also `Win32` to `x64`.
20
- 7. Press F7 on keyboard or select `BUILD` from the menu bar and choose `Build Solution`.
21
- 8. If compilation will be fine a compiled executable will be in `build\VS2010\bin\x64_Release\lz4.exe`
22
-
23
-
24
- #### Projects available within lz4.sln
13
+ #### Projects available within VS2022\lz4.sln
25
14
 
26
15
  The Visual Studio solution file `lz4.sln` contains many projects that will be compiled to the
27
16
  `build\VS2010\bin\$(Platform)_$(Configuration)` directory. For example `lz4` set to `x64` and
@@ -0,0 +1,39 @@
1
+ set /a errorno=1
2
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
3
+
4
+ rem https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
5
+
6
+ set "sln=lz4.sln"
7
+
8
+ @rem set "Configuration=Debug"
9
+ @rem set "Platform=Win32"
10
+
11
+ set "BIN=.\bin\!Platform!_!Configuration!"
12
+ rmdir /S /Q "!BIN!" 2>nul
13
+ echo msbuild "%sln%" /p:Configuration=!Configuration! /p:Platform=!Platform!
14
+ msbuild "%sln%" ^
15
+ /nologo ^
16
+ /v:minimal ^
17
+ /m ^
18
+ /p:Configuration=!Configuration! ^
19
+ /p:Platform=!Platform! ^
20
+ /t:Clean,Build ^
21
+ || goto :ERROR
22
+
23
+ if not exist "!BIN!\datagen.exe" ( echo FAIL: "!BIN!\datagen.exe" && goto :ERROR )
24
+ if not exist "!BIN!\frametest.exe" ( echo FAIL: "!BIN!\frametest.exe" && goto :ERROR )
25
+ if not exist "!BIN!\fullbench-dll.exe" ( echo FAIL: "!BIN!\fullbench-dll.exe" && goto :ERROR )
26
+ if not exist "!BIN!\fullbench.exe" ( echo FAIL: "!BIN!\fullbench.exe" && goto :ERROR )
27
+ if not exist "!BIN!\fuzzer.exe" ( echo FAIL: "!BIN!\fuzzer.exe" && goto :ERROR )
28
+ if not exist "!BIN!\liblz4.dll" ( echo FAIL: "!BIN!\liblz4.dll" && goto :ERROR )
29
+ if not exist "!BIN!\liblz4.lib" ( echo FAIL: "!BIN!\liblz4.lib" && goto :ERROR )
30
+ if not exist "!BIN!\liblz4_static.lib" ( echo FAIL: "!BIN!\liblz4_static.lib" && goto :ERROR )
31
+ if not exist "!BIN!\lz4.exe" ( echo FAIL: "!BIN!\lz4.exe" && goto :ERROR )
32
+
33
+ set /a errorno=0
34
+ goto :END
35
+
36
+ :ERROR
37
+
38
+ :END
39
+ exit /B %errorno%
@@ -0,0 +1,35 @@
1
+ set /a errorno=1
2
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
3
+
4
+ rem https://github.com/Microsoft/vswhere
5
+ rem https://github.com/microsoft/vswhere/wiki/Find-VC#batch
6
+
7
+ set "vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
8
+ if not exist "%vswhere%" (
9
+ echo Failed to find "vswhere.exe". Please install the latest version of Visual Studio.
10
+ goto :ERROR
11
+ )
12
+
13
+ set "InstallDir="
14
+ for /f "usebackq tokens=*" %%i in (
15
+ `"%vswhere%" -latest ^
16
+ -products * ^
17
+ -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
18
+ -property installationPath`
19
+ ) do (
20
+ set "InstallDir=%%i"
21
+ )
22
+ if "%InstallDir%" == "" (
23
+ echo Failed to find Visual C++. Please install the latest version of Visual C++.
24
+ goto :ERROR
25
+ )
26
+
27
+ call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat" || goto :ERROR
28
+
29
+ set /a errorno=0
30
+ goto :END
31
+
32
+ :ERROR
33
+
34
+ :END
35
+ exit /B %errorno%
@@ -0,0 +1,38 @@
1
+ set /a errorno=1
2
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
3
+
4
+ @rem set "Configuration=Debug"
5
+ @rem set "Platform=Win32"
6
+
7
+ set "BIN=.\bin\!Platform!_!Configuration!"
8
+ set "TEST_FILES=..\..\tests\COPYING"
9
+
10
+ echo !BIN!\lz4 -h
11
+ !BIN!\lz4 -h || goto :ERROR
12
+
13
+ echo !BIN!\lz4 -i1b
14
+ !BIN!\lz4 -i1b || goto :ERROR
15
+
16
+ echo !BIN!\lz4 -i1b5
17
+ !BIN!\lz4 -i1b5 || goto :ERROR
18
+
19
+ echo !BIN!\lz4 -i1b10
20
+ !BIN!\lz4 -i1b10 || goto :ERROR
21
+
22
+ echo !BIN!\lz4 -i1b15
23
+ !BIN!\lz4 -i1b15 || goto :ERROR
24
+
25
+ echo fullbench
26
+ !BIN!\fullbench.exe --no-prompt -i1 %TEST_FILES% || goto :ERROR
27
+
28
+ echo fuzzer
29
+ !BIN!\fuzzer.exe -v -T30s || goto :ERROR
30
+
31
+
32
+ set /a errorno=0
33
+ goto :END
34
+
35
+ :ERROR
36
+
37
+ :END
38
+ exit /B %errorno%
@@ -0,0 +1,26 @@
1
+ @setlocal enabledelayedexpansion
2
+ @echo off
3
+ set /a errorno=1
4
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
5
+
6
+ call _setup.bat || goto :ERROR
7
+
8
+ set "Configuration=Debug"
9
+ set "Platform=Win32"
10
+
11
+ call _build.bat || goto :ERROR
12
+ call _test.bat || goto :ERROR
13
+
14
+
15
+ echo Build Status -%esc%[92m SUCCEEDED %esc%[0m
16
+ set /a errorno=0
17
+ goto :END
18
+
19
+
20
+ :ERROR
21
+ echo Abort by error.
22
+ echo Build Status -%esc%[91m ERROR %esc%[0m
23
+
24
+
25
+ :END
26
+ exit /B %errorno%
@@ -0,0 +1,26 @@
1
+ @setlocal enabledelayedexpansion
2
+ @echo off
3
+ set /a errorno=1
4
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
5
+
6
+ call _setup.bat || goto :ERROR
7
+
8
+ set "Configuration=Release"
9
+ set "Platform=Win32"
10
+
11
+ call _build.bat || goto :ERROR
12
+ call _test.bat || goto :ERROR
13
+
14
+
15
+ echo Build Status -%esc%[92m SUCCEEDED %esc%[0m
16
+ set /a errorno=0
17
+ goto :END
18
+
19
+
20
+ :ERROR
21
+ echo Abort by error.
22
+ echo Build Status -%esc%[91m ERROR %esc%[0m
23
+
24
+
25
+ :END
26
+ exit /B %errorno%
@@ -0,0 +1,26 @@
1
+ @setlocal enabledelayedexpansion
2
+ @echo off
3
+ set /a errorno=1
4
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
5
+
6
+ call _setup.bat || goto :ERROR
7
+
8
+ set "Configuration=Debug"
9
+ set "Platform=x64"
10
+
11
+ call _build.bat || goto :ERROR
12
+ call _test.bat || goto :ERROR
13
+
14
+
15
+ echo Build Status -%esc%[92m SUCCEEDED %esc%[0m
16
+ set /a errorno=0
17
+ goto :END
18
+
19
+
20
+ :ERROR
21
+ echo Abort by error.
22
+ echo Build Status -%esc%[91m ERROR %esc%[0m
23
+
24
+
25
+ :END
26
+ exit /B %errorno%
@@ -0,0 +1,26 @@
1
+ @setlocal enabledelayedexpansion
2
+ @echo off
3
+ set /a errorno=1
4
+ for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E"
5
+
6
+ call _setup.bat || goto :ERROR
7
+
8
+ set "Configuration=Release"
9
+ set "Platform=x64"
10
+
11
+ call _build.bat || goto :ERROR
12
+ call _test.bat || goto :ERROR
13
+
14
+
15
+ echo Build Status -%esc%[92m SUCCEEDED %esc%[0m
16
+ set /a errorno=0
17
+ goto :END
18
+
19
+
20
+ :ERROR
21
+ echo Abort by error.
22
+ echo Build Status -%esc%[91m ERROR %esc%[0m
23
+
24
+
25
+ :END
26
+ exit /B %errorno%
@@ -161,13 +161,17 @@
161
161
  </Link>
162
162
  </ItemDefinitionGroup>
163
163
  <ItemGroup>
164
- <ClCompile Include="..\..\..\programs\datagen.c" />
164
+ <ClCompile Include="..\..\..\programs\lorem.c" />
165
+ <ClCompile Include="..\..\..\tests\datagen.c" />
165
166
  <ClCompile Include="..\..\..\tests\datagencli.c" />
167
+ <ClCompile Include="..\..\..\tests\loremOut.c" />
166
168
  </ItemGroup>
167
169
  <ItemGroup>
168
- <ClInclude Include="..\..\..\programs\datagen.h" />
170
+ <ClInclude Include="..\..\..\programs\lorem.h" />
171
+ <ClInclude Include="..\..\..\tests\datagen.h" />
172
+ <ClInclude Include="..\..\..\tests\loremOut.h" />
169
173
  </ItemGroup>
170
174
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171
175
  <ImportGroup Label="ExtensionTargets">
172
176
  </ImportGroup>
173
- </Project>
177
+ </Project>