diff options
author | Adrian Perez <aperezdc@users.noreply.github.com> | 2022-12-16 12:42:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-16 11:42:42 +0100 |
commit | 641bec0e30bea648b3da1cd90fc6b44deb429f71 (patch) | |
tree | 65b8d18522ba04f57332d0c5dc73ba4f79ff54d7 /c/fuzz | |
parent | 3914999fcc1fda92e750ef9190aa6db9bf7bdb07 (diff) | |
download | brotli-641bec0e30bea648b3da1cd90fc6b44deb429f71.zip brotli-641bec0e30bea648b3da1cd90fc6b44deb429f71.tar.gz brotli-641bec0e30bea648b3da1cd90fc6b44deb429f71.tar.bz2 |
CMake: Allow using BUILD_SHARED_LIBS to choose static/shared libs (#655)
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.
Diffstat (limited to 'c/fuzz')
-rwxr-xr-x | c/fuzz/test_fuzzer.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/c/fuzz/test_fuzzer.sh b/c/fuzz/test_fuzzer.sh index 9985194..4b99947 100755 --- a/c/fuzz/test_fuzzer.sh +++ b/c/fuzz/test_fuzzer.sh @@ -13,12 +13,12 @@ mkdir bin cd bin cmake $BROTLI -DCMAKE_C_COMPILER="$CC" \ - -DBUILD_TESTING=OFF -DENABLE_SANITIZER=address -make -j$(nproc) brotlidec-static + -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_SANITIZER=address +make -j$(nproc) brotlidec ${CC} -o run_decode_fuzzer -std=c99 -fsanitize=address -I$SRC/include \ $SRC/fuzz/decode_fuzzer.c $SRC/fuzz/run_decode_fuzzer.c \ - ./libbrotlidec-static.a ./libbrotlicommon-static.a + ./libbrotlidec.a ./libbrotlicommon.a mkdir decode_corpora unzip $BROTLI/java/org/brotli/integration/fuzz_data.zip -d decode_corpora |