From 61f0f263c335ad403c6693a1b8b6f5428ac180a8 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Aug 2017 18:25:05 +0200 Subject: Fixed LUA Nested Table Issues. Added LUA2C for User Defined Plugins --- conf.d/cmake/config.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'conf.d/cmake') diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index 73a00f6..4719486 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -65,9 +65,9 @@ set (PKG_REQUIRED_LIST lua>=5.3 ) + # Define CONTROL_CDEV_NAME should match MOST driver values # --------------------------------------------------------- - set(LUA_COMPILER "luac5.3" CACHE STRING "LUA syntaxe check") add_compile_options(-DCONTROL_ONLOAD_DEFAULT="onload-default") add_compile_options(-DCONTROL_MAXPATH_LEN=255) add_compile_options(-DCONTROL_DOSCRIPT_PRE="doscript") @@ -75,9 +75,17 @@ set (PKG_REQUIRED_LIST add_compile_options(-DCONTROL_CONFIG_POST="control" ) add_compile_options(-DCONTROL_CONFIG_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/config.d:${CMAKE_INSTALL_PREFIX}/controler/config.d") - add_compile_options(-DCONTROL_LUA_EVENT="luaevt") - add_compile_options(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controler/ctl-lua.d") - + + set(CONTROL_SUPPORT_LUA 1 CACHE BOOL "Active or not LUA Support") + if(CONTROL_SUPPORT_LUA) + set(LUA_COMPILER "luac5.3" CACHE STRING "LUA syntaxe check") + add_compile_options(-DCONTROL_SUPPORT_LUA) + add_compile_options(-DCONTROL_LUA_EVENT="luaevt") + add_compile_options(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controler/ctl-lua.d") + else(CONTROL_SUPPORT_LUA) + message(STATUS "Warning: LUA Without Support ") + endif(CONTROL_SUPPORT_LUA) + set (CTL_PLUGIN_PRE "ctl-" CACHE STRING "Prefix for Controler share plugin") set (CTL_PLUGIN_EXT ".ctlso" CACHE STRING "Postfix for Controler share plugin") add_compile_options(-DCTL_PLUGIN_MAGIC=2468013579) -- cgit From a7d41a6fa1e29d800ce8ac9e95e8f943814463e8 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Fri, 18 Aug 2017 01:09:56 +0200 Subject: Integration with Alsa HookPlugin is now working. --- conf.d/cmake/config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'conf.d/cmake') diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index 4719486..9293781 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -73,7 +73,7 @@ set (PKG_REQUIRED_LIST add_compile_options(-DCONTROL_DOSCRIPT_PRE="doscript") add_compile_options(-DCONTROL_CONFIG_PRE="onload") add_compile_options(-DCONTROL_CONFIG_POST="control" ) - add_compile_options(-DCONTROL_CONFIG_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/config.d:${CMAKE_INSTALL_PREFIX}/controler/config.d") + add_compile_options(-DCONTROL_CONFIG_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/config.d:${CMAKE_INSTALL_PREFIX}/controller/config.d") set(CONTROL_SUPPORT_LUA 1 CACHE BOOL "Active or not LUA Support") @@ -81,13 +81,13 @@ set (PKG_REQUIRED_LIST set(LUA_COMPILER "luac5.3" CACHE STRING "LUA syntaxe check") add_compile_options(-DCONTROL_SUPPORT_LUA) add_compile_options(-DCONTROL_LUA_EVENT="luaevt") - add_compile_options(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controler/ctl-lua.d") + add_compile_options(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controller/ctl-lua.d") else(CONTROL_SUPPORT_LUA) message(STATUS "Warning: LUA Without Support ") endif(CONTROL_SUPPORT_LUA) - set (CTL_PLUGIN_PRE "ctl-" CACHE STRING "Prefix for Controler share plugin") - set (CTL_PLUGIN_EXT ".ctlso" CACHE STRING "Postfix for Controler share plugin") + set (CTL_PLUGIN_PRE "ctl-" CACHE STRING "Prefix for Controller share plugin") + set (CTL_PLUGIN_EXT ".ctlso" CACHE STRING "Postfix for Controller share plugin") add_compile_options(-DCTL_PLUGIN_MAGIC=2468013579) add_compile_options(-DCONTROL_PLUGIN_PATH="${CMAKE_BINARY_DIR}:${BINDINGS_INSTALL_DIR}/ctlplug:/usr/lib/afb/ctlplug") -- cgit From de625486c6dcfd3372a46d43988e5d5f809d2da9 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 18 Aug 2017 16:33:18 +0200 Subject: Change how to define compile options Move specific compilation options to the target it is related keep global compilation option in config.cmake then variable can be correctly evaluated and use with the correct values (CMAKE_INSTALL_PREFIX isn't the same before common.cmake inclusion and after.) Change-Id: Ia3c3fe6bc6fcdcb79858f233b108b9ee1e071131 Signed-off-by: Romain Forlot --- conf.d/cmake/config.cmake | 71 ++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 32 deletions(-) (limited to 'conf.d/cmake') diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index 9293781..e40bf7c 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -41,12 +41,6 @@ set(PROJECT_SRC_DIR_PATTERN "[^_]*") # ---------------------------------- set(CMAKE_BUILD_TYPE "DEBUG") -# Static constante definition -# ----------------------------- -add_compile_options(-DMAX_SND_CARD=16) # should be more than enough even in luxury vehicule -add_compile_options(-DMAX_LINEAR_DB_SCALE=24) # until 24db volume normalisation use a simple linear scale -add_compile_options(-DTLV_BYTE_SIZE=256) # Alsa use 4096 as default but 256 should fit most sndcards - # Compiler selection if needed. Overload the detected compiler. # ----------------------------------------------- set (gcc_minimal_version 4.9) @@ -65,37 +59,50 @@ set (PKG_REQUIRED_LIST lua>=5.3 ) +# Controller project needed variables. +# Compilation options specific to that target set +# in the CMakeLists.txt of that target to correctly +# expand variables. +# ---------------------------------------------------- +set(CONTROL_SUPPORT_LUA 1 CACHE BOOL "Active or not LUA Support") +set (CTL_PLUGIN_PRE "ctl-" CACHE STRING "Prefix for Controller share plugin") +set (CTL_PLUGIN_EXT ".ctlso" CACHE STRING "Postfix for Controller share plugin") + +# Compilation options definition +# Use CMake generator expressions to specify only for a specific language +# Values are prefilled with default options that is currently used. +# Either separate options with ";", or each options must be quoted separately +# DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED ! +# ---------------------------------------------------------------------------- +set(COMPILE_OPTIONS +-Wall +-Wextra +-Wconversion +-Wno-unused-parameter +-Wno-sign-compare +-Wno-sign-conversion +-Werror=maybe-uninitialized +-Werror=implicit-function-declaration +-ffunction-sections +-fdata-sections +-fPIC +# Personal compilation options +-DMAX_SND_CARD=16 # should be more than enough even in luxury vehicule +-DMAX_LINEAR_DB_SCALE=24 # until 24db volume normalisation use a simple linear scale +-DTLV_BYTE_SIZE=256 # Alsa use 4096 as default but 256 should fit most sndcards +-DCONTROL_MAXPATH_LEN=255 + CACHE STRING "Compilation flags") +#set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.") +#set(CXX_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C++ language.") +#set(PROFILING_COMPILE_OPTIONS -g -O0 -pg -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for PROFILING build type.") +#set(DEBUG_COMPILE_OPTIONS -g -ggdb -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for DEBUG build type.") +#set(CCOV_COMPILE_OPTIONS -g -O2 --coverage CACHE STRING "Compilation flags for CCOV build type.") +#set(RELEASE_COMPILE_OPTIONS -g -O2 CACHE STRING "Compilation flags for RELEASE build type.") -# Define CONTROL_CDEV_NAME should match MOST driver values -# --------------------------------------------------------- - add_compile_options(-DCONTROL_ONLOAD_DEFAULT="onload-default") - add_compile_options(-DCONTROL_MAXPATH_LEN=255) - add_compile_options(-DCONTROL_DOSCRIPT_PRE="doscript") - add_compile_options(-DCONTROL_CONFIG_PRE="onload") - add_compile_options(-DCONTROL_CONFIG_POST="control" ) - add_compile_options(-DCONTROL_CONFIG_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/config.d:${CMAKE_INSTALL_PREFIX}/controller/config.d") - - - set(CONTROL_SUPPORT_LUA 1 CACHE BOOL "Active or not LUA Support") - if(CONTROL_SUPPORT_LUA) - set(LUA_COMPILER "luac5.3" CACHE STRING "LUA syntaxe check") - add_compile_options(-DCONTROL_SUPPORT_LUA) - add_compile_options(-DCONTROL_LUA_EVENT="luaevt") - add_compile_options(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controller/ctl-lua.d") - else(CONTROL_SUPPORT_LUA) - message(STATUS "Warning: LUA Without Support ") - endif(CONTROL_SUPPORT_LUA) - - set (CTL_PLUGIN_PRE "ctl-" CACHE STRING "Prefix for Controller share plugin") - set (CTL_PLUGIN_EXT ".ctlso" CACHE STRING "Postfix for Controller share plugin") - add_compile_options(-DCTL_PLUGIN_MAGIC=2468013579) - add_compile_options(-DCONTROL_PLUGIN_PATH="${CMAKE_BINARY_DIR}:${BINDINGS_INSTALL_DIR}/ctlplug:/usr/lib/afb/ctlplug") - # Print a helper message when every thing is finished # ---------------------------------------------------- set(CLOSING_MESSAGE "Debug in ./buid: afb-daemon --port=1234 --ldpaths=. --workdir=. --roothttp=../htdocs --tracereq=common --token='' --verbose") - # Optional dependencies order # --------------------------- #set(EXTRA_DEPENDENCIES_ORDER) -- cgit From 7d3aa94e8be267a166caf4e2c6f29529aa4cabbd Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 18 Aug 2017 17:52:21 +0200 Subject: Added default variables from sample Change-Id: I9170f9834868035ab76faaaae941f2c5decf589d Signed-off-by: Romain Forlot --- conf.d/cmake/config.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'conf.d/cmake') diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index e40bf7c..b5e3a4c 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -102,6 +102,12 @@ set(COMPILE_OPTIONS # Print a helper message when every thing is finished # ---------------------------------------------------- set(CLOSING_MESSAGE "Debug in ./buid: afb-daemon --port=1234 --ldpaths=. --workdir=. --roothttp=../htdocs --tracereq=common --token='' --verbose") +#set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt") + +# Optional location for config.xml.in +# ----------------------------------- +#set(WIDGET_ICON conf.d/wgt/${PROJECT_ICON} CACHE PATH "Path to the widget icon") +#set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)") # Optional dependencies order # --------------------------- -- cgit