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

Zephyr: CMake error when Log Management is enabled. #86

Open
NZSmartie opened this issue Jun 13, 2020 · 0 comments
Open

Zephyr: CMake error when Log Management is enabled. #86

NZSmartie opened this issue Jun 13, 2020 · 0 comments

Comments

@NZSmartie
Copy link

Modifying samples/smp_svr/zephyr/prj.conf and adding

CONFIG_MCUMGR_CMD_LOG_MGMT=y

to the following file:

# Enable all core commands.
CONFIG_MCUMGR_CMD_FS_MGMT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_STAT_MGMT=y

Building the sample application with west build will cause CMake to error with the following:

CMake Error at ../../../cmd/log_mgmt/CMakeLists.txt:29:
  Parse error.  Expected "(", got newline with text "

  ".


-- Configuring incomplete, errors occurred!

The CMakesLists.txt file has a couple of errors.

if(CONFIG_MCUMGR)
target_include_directories(MCUMGR INTERFACE
include
)
zephyr_library_sources(
cmd/log_mgmt/port/zephyr/src/zephyr_log_mgmt.c
cmd/log_mgmt/src/log_mgmt.c
cmd/log_mgmt/src/stubs.c
)
endif

Adding parentheses to the trailing endif (becomming endif())will fix the syntax error, but then present a new error:

CMake Error at /home/nzsmartie/projects/smartbike/zephyr/cmake/extensions.cmake:372 (add_library):
  Cannot find source file:

    /home/nzsmartie/projects/smartbike/modules/lib/mcumgr/cmd/log_mgmt/cmd/log_mgmt/port/zephyr/src/zephyr_log_mgmt.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  /home/nzsmartie/projects/smartbike/zephyr/cmake/extensions.cmake:349 (zephyr_library_named)
  ../../../CMakeLists.txt:21 (zephyr_library)

the source files listed are prefixed with cmd/log_mgmt/ which is the directory the current CMakeLsits.txt file is in. Removing the prefix resolves the CMake errors.

NZSmartie added a commit to NZSmartie/mynewt-mcumgr that referenced this issue Jun 13, 2020
Part of apache#86, enabling
this option highlights the failed CMake configuration due to lack of
log_mgmnt command from being compiled.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
NZSmartie added a commit to NZSmartie/mynewt-mcumgr that referenced this issue Jun 13, 2020
Fixes a CMake error due to missing parantheses on an `endif` and
corrects source file paths.

Fixes apache#86 (apache#86)

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
NZSmartie added a commit to NZSmartie/mynewt-mcumgr that referenced this issue Jun 13, 2020
Fixes a CMake error due to missing parentheses on an `endif` and
corrects source file paths.

Fixes apache#86 (apache#86)

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant