By convention projects using CMake which can build either static or
shared libraries use a BUILD_SHARED_LIBS flag to allow selecting between
both: the add_library() command automatically switches between both using
this variable when the library kind is not passed to add_library(). It
is also usual to expose the BUILD_SHARED_LIBS as an user-facing setting
with the option() command.
This way, the following will both work as expected:
% cmake -DBUILD_SHARED_LIBS=OFF ...
% cmake -DBUILS_SHARED_LIBS=ON ...
This is helpful for distributions which need (or want) to build only
static libraries.
Documentation:
- add note that brotli is a "stream" format, not an archive-like
- regenerate .1 with Pandoc
Build:
- drop legacy "BROTLI_BUILD_PORTABLE" option
- drop "BROTLI_SANITIZED" definition
Code:
- c: comb includes
- c/enc: extract encoder state into separate header
- c/enc: drop designated q10 codepath
- c/enc: dealing better with flushing of empty stream
- fix MSVC compilation
API:
- py: use library version instead of one in version.h
- c: add plugable API to report consumed input / produced output
- c/java: support "lean" prepared dictionaries (without copy of source)
* Wrap interface include directories with BUILD_INTERFACE generator expression
When exporting a CMake target using install(TARGETS) + install(EXPORT),
CMake requires all include directories to be clean of build system
directories.
https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.html
This change also allows use of brotli as a CMake subproject and
installing + exporting it.
* Fix typo in generator expression
Not providing VERSION to "project" command will cause a warning.
Since this project's version is loaded from other files, this policy will help suppress the warning generated by cmake.
This policy is set because we can't provide "VERSION" in "project" command.
Use `cmake --help-policy CMP0048` for more information
Add an option to avoid building shared libraries (for building with EMCC)
Drive-by:
* maven: ramp up java level to minimal required
* travis: replace deprecated clang-5.0 with clang-7
* maven: fallback to jdk10 to void javadoc bug
* build: add cross-compilation support to make
Set CROSS_COMPILE when running make to use the selected cross
compilation toolchain, such as arm-linux-gnueabihf, or
aarch64-linux-gnu.
Testing requires the presence of qemu - 'qemu-$(ARCH)' will be executed,
where ARCH is the first part of the toolchain triplet.
* build: add cross-compilation support to cmake
If C_COMPILER/CXX_COMPILER/CC/CXX are found to have cross-compilation
triplets in front of the compiler, then qemu will be used to execute the
tests.
* CI: add arm-linux-gnueabihf-gcc builder to Travis
The version of qemu available in Ubuntu trusty (as provided by Travis)
appears to have a bug in qemu-aarch64, which leads to the compatibility
tests failing on some inputs, erroneously rejecting the input as
corrupt.
Once Travis supports xenial, we could add an aarch64-gnu-linux-gcc
builder as well.
* CI: propagate cmake errors out of .travis.sh
Seems like even if cmake fails, the error isn't picked up by Travis.
Set bundled mode to ON when parent directory is not empty. Due to the
peculiarities of CMake if, comparing an undefined variable to the empty
string is false, so this likely never triggered.
By default CMake checks both for C and C++ compilers, while the latter
is not needed. Setting the list of languages to just "C" in the call to
project() removes the unneeded check.
* add autotools build
* separate semantic and ABI version
* extract sources.lst (used by CMake and Automake)
* share pkgconfig templates (used by CMake and Automake)
* decoder: always set `total_out`
* encoder: fix `BROTLI_ENSURE_CAPACITY` macro (no-op after preprocessor)
* decoder/encoder: refine `free_func` contract
* pull `BROTLI_MAX_BACKWARD_LIMIT` to constants
* split generic and Zopfli backward references code
* pull hashers init and stitch invocation to encoder
* make `dictionary_hash` a compilation unit
* add `size hint` parameter
* add new hasher
* use `size hint` to pick new hasher for q4
* modernize clz guard (fix#495)
* move `hash to binary tree` to separate file
* add `Initialize` and `Cleanup` to all hashers
* do not raise OOM if malloc(0) == NULL (fix#500)
* Declare `BUILD_SHARED_LIBS` option for CMake
* Define `${LIB}_SHARED_COMPILATION` when compiling shared library
* Define and use BROTLI_xxx_API
* Fix remaining unprefixed defines in port.h