Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes for yocto build #2

Open
wants to merge 3 commits into
base: everest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ find_library(LIBRT rt)
option(LIBNFCNCI_BUILD_EXAMPLES "enable building of examples" OFF)
option(LIBNFCNCI_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})

set (VAR_LIBNFCNCI_CONFIG_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/etc/libnfc_config/")
if (NOT LIBNFCNCI_CONFIG_INSTALL_PATH)
set (LIBNFCNCI_CONFIG_INSTALL_PATH "${CMAKE_INSTALL_SYSCONFDIR}/everest/libnfc_config/")
endif()

set (LIBNFCNCI_CONFIG_FILES
conf/libnfc-nci.conf
Expand Down Expand Up @@ -211,7 +213,7 @@ set (LIBNFCNCI_INCLUDE_DIRS
)

set (COMPILE_DEFINITIONS
-DCONFIG_PATH="${VAR_LIBNFCNCI_CONFIG_INSTALL_PATH}"
-DCONFIG_PATH="${LIBNFCNCI_CONFIG_INSTALL_PATH}"
-DNFC_CFG_DEBUG=FALSE
-DNFC_NXP_NOT_OPEN_INCLUDED=TRUE
-DNXP_HW_SELF_TEST
Expand Down Expand Up @@ -244,7 +246,7 @@ target_compile_definitions(libnfc_nci

set_target_properties(libnfc_nci
PROPERTIES
LIBNFCNCI_CONFIG_INSTALL_PATH "${VAR_LIBNFCNCI_CONFIG_INSTALL_PATH}"
LIBNFCNCI_CONFIG_INSTALL_PATH "${LIBNFCNCI_CONFIG_INSTALL_PATH}"
)

# NOTE (aw): this is dangerous
Expand Down Expand Up @@ -308,15 +310,15 @@ if (LIBNFCNCI_INSTALL)
)

install(FILES ${LIBNFCNCI_CONFIG_FILES}
DESTINATION "${VAR_LIBNFCNCI_CONFIG_INSTALL_PATH}"
DESTINATION "${LIBNFCNCI_CONFIG_INSTALL_PATH}"
)

evc_setup_package(
NAME libnfc_nci
NAME libnfc-nci
EXPORT libnfc_nci-targets
NAMESPACE libnfc_nci
PATH_VARS
LIBNFCNCI_CONFIG_INSTALL_PATH "${VAR_LIBNFCNCI_CONFIG_INSTALL_PATH}"
LIBNFCNCI_CONFIG_INSTALL_PATH "${LIBNFCNCI_CONFIG_INSTALL_PATH}"
ADDITIONAL_CONTENT
"find_dependency(Threads)"
"set_target_properties(libnfc_nci::libnfc_nci PROPERTIES LIBNFCNCI_CONFIG_INSTALL_PATH \"@PACKAGE_LIBNFCNCI_CONFIG_INSTALL_PATH@\")"
Expand Down
16 changes: 5 additions & 11 deletions src/nxp_nci_hal_libnfc-nci/utils/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -865,21 +865,15 @@ extern "C" int GetStrValue(const char* name, char* pValue, unsigned long l)
// printf("%s: NCI Config Parameter :%s = (0x%x)\n", __FUNCTION__, name, v);
}

switch (len)
{
case sizeof(unsigned int):
if (len == sizeof(unsigned int)) {
*(static_cast<unsigned int*>(pValue)) = (unsigned int)v;
break;
case sizeof(unsigned long):
} else if (len == sizeof(unsigned long)) {
*(static_cast<unsigned long*>(pValue)) = (unsigned long)v;
break;
case sizeof(unsigned short):
} else if (len == sizeof(unsigned short)) {
*(static_cast<unsigned short*>(pValue)) = (unsigned short)v;
break;
case sizeof(unsigned char):
} else if (len == sizeof(unsigned char)) {
*(static_cast<unsigned char*> (pValue)) = (unsigned char)v;
break;
default:
} else {
return false;
}
return true;
Expand Down