meson: find ldap instead of link flags
The current meson adds link flags for libldap directly. This makes that
meson doesn't error out until compilation (e.g., report missing ldap.h).
This commit adds the ldap dependency explicitly and makes it required.
Tested:
1. CI works
2. bitbake works
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I7513a1a825b28c85afc51248e5b93d69a34e82f4
diff --git a/phosphor-ldap-config/meson.build b/phosphor-ldap-config/meson.build
index c647008..925ff8d 100644
--- a/phosphor-ldap-config/meson.build
+++ b/phosphor-ldap-config/meson.build
@@ -1,8 +1,11 @@
+ldap_dep = meson.get_compiler('cpp').find_library('ldap', required: true)
+
phosphor_ldap_conf_deps = [
cereal_dep,
phosphor_dbus_interfaces_dep,
phosphor_logging_dep,
sdbusplus_dep,
+ ldap_dep,
]
phosphor_ldap_conf_lib = static_library(
@@ -28,6 +31,5 @@
'main.cpp',
include_directories: '..',
dependencies: phosphor_ldap_conf_dep,
- link_args: ['-lldap'],
install: true,
)