Skip to content

Commit

Permalink
allow version detection to do something sane if not in a git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmeagher committed Jul 24, 2023
1 parent c842b47 commit 6c25bb3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ sphinx_build = find_program('sphinx-build',required:false)

if sphinx_build.found() and doxygen.found()

version = run_command('git', 'describe', '--tags', '--always', check:true).stdout().strip()
version_cmd = run_command('git', 'describe', '--tags', '--always', check:false)
if version_cmd.returncode() == 0
version = version_cmd.stdout().strip()
else
version = meson.project_version()
endif
message('Building Docs as version='+version)

docs_config = {
'CPP_SOURCE_DIR' : meson.project_source_root() + '/src',
'DOCS_SOURCE_DIR' : meson.current_source_dir(),
Expand Down

0 comments on commit 6c25bb3

Please sign in to comment.