Skip to content
Snippets Groups Projects
Commit d1e39f82 authored by Zbigniew Bodek's avatar Zbigniew Bodek
Browse files

Improve TARGET_ADAPTER selection using python function


Add get_target_adapter() to return proper TARGET_ADAPTER
type for linux, liteos_a or liteos_m. Raise an exception
when the target system is not supported.

Signed-off-by: default avatarZbigniew Bodek <zbigniew.bodek@huawei.com>
parent d34bce46
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,17 @@ S = "${WORKDIR}/git" ...@@ -18,8 +18,17 @@ S = "${WORKDIR}/git"
CFLAGS_SAMGR = "${CFLAGS} -I${S}/samgr/adapter -I${S}/samgr -I${S}/samgr/source -I${S}/samgr/registry -fPIC -shared" CFLAGS_SAMGR = "${CFLAGS} -I${S}/samgr/adapter -I${S}/samgr -I${S}/samgr/source -I${S}/samgr/registry -fPIC -shared"
LDFLAGS_SAMGR = "${LDFLAGS} -lsec -pthread -L${B} -Wl,-soname,lib${PN}.so.${PVMAJOR}" LDFLAGS_SAMGR = "${LDFLAGS} -lsec -pthread -L${B} -Wl,-soname,lib${PN}.so.${PVMAJOR}"
# Note: modify this when adapting to LiteOS def get_target_adapter(d):
TARGET_ADAPTER = '${@ "posix" if "linux" in d.getVar("TARGET_OS", False) else "cmsis"}' targetOs = d.getVar('TARGET_OS', True)
if targetOs == "linux" or targetOs == "liteos_a":
targetAdapter = "posix"
elif targetOs == "liteos_m":
targetAdapter = "cmsis"
else:
raise bb.parse.SkipPackage("OS '%s' is not supported by ohos-foundation" % targetOs)
return targetAdapter
TARGET_ADAPTER = "${@get_target_adapter(d)}"
do_compile () { do_compile () {
${CC} ${CFLAGS_SAMGR} ${LDFLAGS_SAMGR} \ ${CC} ${CFLAGS_SAMGR} ${LDFLAGS_SAMGR} \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment