Zstd: Improve the buildsystem

Created on 31 May 2017  路  9Comments  路  Source: facebook/zstd

At this point, we have multiple choice to what we want to install through zstd, for example:
thread support, lz4 support, xz support, gzip support, pzstd support and so on.

I guess that the best way to handle those supports is via a build system which provides a script that accepts configure options (autotools-based, cmake, etc).

Yes, I saw there is a cmake support, but it can be improved using a CMakeLists.txt file and have a flag for each thing we want to build or not.

It would also help downstream packagers.
Thanks.

enhancement

Most helpful comment

I agree that we need a configure script. I'll put it on my queue.

All 9 comments

To explain a bit better:

I'd expect to have a configure, that launched ad ./configure --help prints all support I can enable, so, then I can do:

./configure --enable-lz4 --disable-xz --disable-static

and not dig into the makefile and analyze dozens of targets

That's a good point @asarubbo .
Btw, we happily accept PR to improve the cmake build script.

I agree that we need a configure script. I'll put it on my queue.

@asarubbo Now we have meson build which support configure. Follow instructions in build/meson.

Hey @asarubbo @Cyan4973 .
As @lzutao said, zstd have meson support with these options:
backtrace
build_contrib
build_programs
build_tests
debug_level
legacy_level
lz4
lzma
multi_thread
static_runtime
zlib

And I noticed that the build/cmake/CMakeLists.txt already has cmake option for multi thread and something else, and build/cmake/programs/CMakeLists.txt has cmake options for zlib and lzma:
option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON)
option(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF)
option(ZSTD_BUILD_TESTS "BUILD TESTS" OFF)
option(ZSTD_MULTITHREAD_SUPPORT "MULTITHREADING SUPPORT" ON)
option(ZSTD_ZLIB_SUPPORT "ZLIB SUPPORT" OFF)
option(ZSTD_LZMA_SUPPORT "LZMA SUPPORT" OFF).
These cmake options can be listed and configured like
cmake -LH
cmake -DZSTD_BUILD_TESTS=ON.

But it seems that the cmake scripts lack some options:
ZSTD_LZ4_SUPPORT
ZSTD_DEBUG_LEVEL
And the cmake instructions can be provided for guys not familiar with cmake.
Maybe I can improve the cmake build scripts. What do you think @Cyan4973 ?

Do you want to update the cmake script with these additional options ?

Yes. And I want to improve the README.md in build/cmake to give some guides for users not familiar with cmake. Is it OK?

Sure !

cmake script was improved LeeYoung624,
but there is still no ./configure script.
That being said, does the project need one ? for which purpose ?

@terrelln , is that still an opened direction ?

Was this page helpful?
0 / 5 - 0 ratings