aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-18 14:22:56 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-07-18 23:38:49 +0200
commitd0acc2ac12dcb6aea8e8efccdf366bea4e1a2dbd (patch)
tree84212c4312dfd20eef580e7ed8708541b77626b3 /cmake
parent6fb38467ca1609a1aa1be865b38648f37861af7e (diff)
Add support to binding version 3.
Add a new LABELS "BINDINGV3" to handle the v3 case. This implies the same things than for v2 but generates the API definition using the new version capabilities through afb-genskel tool. Change-Id: Ib7b60f3f79c3634f27c90b2f9bf4aaf5b3ef2fcb Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cmake.d/03-macros.cmake17
1 files changed, 13 insertions, 4 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index ba4c470..e8a95d7 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -258,13 +258,16 @@ endmacro()
# To be call inside project_targets_populate macro
macro(afb_genskel)
+ set (ARGSLIST ${ARGN})
+
if ("${PROJECT_LANGUAGES}" MATCHES "CXX")
- list(APPEND GENSKEL_OPTS "--cpp")
+ list(APPEND ARGSLIST "--cpp")
endif()
+
if (OPENAPI_DEF)
add_custom_command(OUTPUT ${SD}/${OPENAPI_DEF}.h
DEPENDS ${SD}/${OPENAPI_DEF}.json
- COMMAND afb-genskel ${GENSKEL_OPTS} ${SD}/${OPENAPI_DEF}.json > ${SD}/${OPENAPI_DEF}.h
+ COMMAND afb-genskel ${ARGSLIST} ${SD}/${OPENAPI_DEF}.json > ${SD}/${OPENAPI_DEF}.h
)
add_custom_target("${TARGET}_GENSKEL" DEPENDS ${SD}/${OPENAPI_DEF}.h
COMMENT "Generating OpenAPI header file ${OPENAPI_DEF}.h")
@@ -272,7 +275,7 @@ macro(afb_genskel)
else()
add_custom_command(OUTPUT ${SD}/${OUT}-apidef.h
DEPENDS ${SD}/${OUT}-apidef.json
- COMMAND afb-genskel ${GENSKEL_OPTS} ${SD}/${OUT}-apidef.json > ${SD}/${OUT}-apidef.h
+ COMMAND afb-genskel ${ARGSLIST} ${SD}/${OUT}-apidef.json > ${SD}/${OUT}-apidef.h
)
add_custom_target("${TARGET}_GENSKEL" DEPENDS ${SD}/${OUT}-apidef.h
COMMENT "Generating OpenAPI header file ${OUT}-apidef.h")
@@ -346,7 +349,13 @@ macro(project_targets_populate)
if(NOT S)
set(S ".so")
endif()
- afb_genskel()
+ afb_genskel("-2")
+ generate_one_populate_target(${P}${OUT}${S} ${PACKAGE_LIBDIR})
+ elseif(${T} STREQUAL "BINDINGV3")
+ if(NOT S)
+ set(S ".so")
+ endif()
+ afb_genskel("-3")
generate_one_populate_target(${P}${OUT}${S} ${PACKAGE_LIBDIR})
elseif(${T} STREQUAL "EXECUTABLE")
if(NOT S)