Skip to content

Commit

Permalink
build(meson): use override_dependency if supported (#116)
Browse files Browse the repository at this point in the history
This improves user experience when using tomlplusplus as a Meson
subproject.

With this change users will be able to simply call
dependency('tomlplusplus') and have Meson automatically resolve the
dependency from the subproject if it is not found on the system.

Without this, users always have to explicitly call
dependency('tomlplusplus', fallback:['tomlplusplus','tomlplusplus_dep'])

A lot of saved keystrokes :)
  • Loading branch information
Tachi107 committed Sep 22, 2021
1 parent 73870ce commit fe28ec8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meson.build
Expand Up @@ -508,6 +508,10 @@ tomlplusplus_dep = declare_dependency(
version: meson.project_version(),
)

if meson.version().version_compare('>=0.54.0')
meson.override_dependency('tomlplusplus', tomlplusplus_dep)
endif

if not is_subproject
import('pkgconfig').generate(
name: meson.project_name(),
Expand Down

0 comments on commit fe28ec8

Please sign in to comment.