mirror of
https://github.com/facebook/zstd.git
synced 2025-10-04 00:02:33 -04:00
meson: get version up front
Run the scraper command to establish the project version immediately, rather than wait for the build to be configured. This simplifies the code and ensures that project introspection works correctly.
This commit is contained in:
parent
4d82a4d3f2
commit
6c3ed93c27
@ -23,7 +23,9 @@ project('zstd',
|
||||
# so this isn't safe
|
||||
#'werror=true'
|
||||
],
|
||||
version: 'DUMMY',
|
||||
version: run_command(
|
||||
find_program('GetZstdLibraryVersion.py'), '../../lib/zstd.h',
|
||||
check: true).stdout().strip(),
|
||||
meson_version: '>=0.48.0')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
@ -45,16 +47,6 @@ compiler_msvc = 'msvc'
|
||||
|
||||
zstd_version = meson.project_version()
|
||||
|
||||
zstd_h_file = join_paths(meson.current_source_dir(), '../../lib/zstd.h')
|
||||
GetZstdLibraryVersion_py = find_program('GetZstdLibraryVersion.py', native : true)
|
||||
r = run_command(GetZstdLibraryVersion_py, zstd_h_file)
|
||||
if r.returncode() == 0
|
||||
zstd_version = r.stdout().strip()
|
||||
message('Project version is now: @0@'.format(zstd_version))
|
||||
else
|
||||
error('Cannot find project version in @0@'.format(zstd_h_file))
|
||||
endif
|
||||
|
||||
zstd_libversion = zstd_version
|
||||
|
||||
# =============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user