Skip to content

Commit

Permalink
uapi: move doc target to parent meson.build file
Browse files Browse the repository at this point in the history
All cargo related target and vars are in top level uapi  directory.
  • Loading branch information
fvalette-ledger committed Nov 27, 2024
1 parent f0219e9 commit 65880cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
22 changes: 22 additions & 0 deletions uapi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,28 @@ uapi_manifest = files('Cargo.toml')
subdir('include/uapi')
subdir('src')

cargo = find_program('cargo', required: true)
cargo_fmt = find_program('cargo-fmt', required: false)
cargo_clippy = find_program('cargo-clippy', required: false)
cargo_index = find_program('cargo-index', required: false)

if with_doc_opt
uapi_doc = custom_target(
'doc-uapi',
input: uapi_manifest,
output: 'doc',
command: [cargo, 'doc', '--manifest-path', '@INPUT@'],
depend_files: [uapi_modules, uapi_libfile],
env: {'CARGO_TARGET_DIR':meson.current_build_dir()},
install: true,
install_dir: get_option('datadir') / 'doc/sentry-uapi',
install_tag: 'doc',
)

uapi_doc_alias = alias_target('doc-uapi', uapi_doc)

endif # with_doc

install_data(
'task.Kconfig',
install_dir : get_option('datadir') / 'configs',
Expand Down
21 changes: 0 additions & 21 deletions uapi/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,7 @@ pkg_config.generate(
extra_cflags: [ global_build_args, target_arch_args ],
)

cargo = find_program('cargo', required: true)

if with_doc_opt
gen_cargo_doc = custom_target(
'forge_cargo_doc',
output: 'doc',
command: [
cargo,
'doc',
'--lib',
'--package', 'sentry-uapi',
'--examples',
'--manifest-path', uapi_manifest[0].full_path(),
],
install: true,
env: {'CARGO_TARGET_DIR':meson.current_build_dir()},
install_dir: get_option('datadir') / 'doc/sentry-uapi',
install_tag: 'doc',
build_by_default: true,
build_always_stale: true,
)
endif # with_doc

if with_tests
cargo_options = [ '--manifest-path', uapi_manifest[0].full_path() ]
Expand Down

0 comments on commit 65880cd

Please sign in to comment.