meson: Allow absence of abi-compliance-check tools
Fixes:
```
Configuring config.h using configuration
Dependency gtest found: YES 1.12.1 (cached)
Dependency gmock found: YES 1.12.1 (cached)
Program abi-dumper found: NO
Program abi-compliance-checker found: NO
../meson.build:85:4: ERROR: Tried to use not-found external program in "command"
```
Tested by issuing `meson setup build && meson compile -C build` both
without and with `abi-dump` and `abi-compliance-checker` installed.
I verified that in the former case we don't fail setup and in the latter
case we check for ABI compliance.
Reported-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ie47c3c0309316cf9d9a46ed26a5a60ee011b6adf
diff --git a/meson.build b/meson.build
index a249774..80d0c93 100644
--- a/meson.build
+++ b/meson.build
@@ -82,28 +82,30 @@
abi_compliance_checker.found() and \
import('fs').is_file(baseline_dump)
- current_dump = custom_target('abi-dump',
- input: libpldm,
- output: 'current.dump',
- command: [ abi_dumper,
- '-public-headers',
- meson.project_source_root() / 'include',
- '@INPUT@',
- '-o',
- '@OUTPUT@',
- '-lver',
- meson.project_version()])
- abi_compliance = custom_target('abi-compliance',
- input: [baseline_dump, current_dump],
- output: 'abi-compliance',
- command: [ abi_compliance_checker,
- '-l',
- meson.project_name(),
- '-old',
- '@INPUT0@',
- '-new',
- '@INPUT1@' ],
- build_by_default: test_abi_compliance)
+ if test_abi_compliance
+ current_dump = custom_target('abi-dump',
+ input: libpldm,
+ output: 'current.dump',
+ command: [ abi_dumper,
+ '-public-headers',
+ meson.project_source_root() / 'include',
+ '@INPUT@',
+ '-o',
+ '@OUTPUT@',
+ '-lver',
+ meson.project_version()])
+ abi_compliance = custom_target('abi-compliance',
+ input: [baseline_dump, current_dump],
+ output: 'abi-compliance',
+ command: [ abi_compliance_checker,
+ '-l',
+ meson.project_name(),
+ '-old',
+ '@INPUT0@',
+ '-new',
+ '@INPUT1@' ],
+ build_by_default: true)
+ endif
endif
endif