mynewt-mcumgr icon indicating copy to clipboard operation
mynewt-mcumgr copied to clipboard

Zephyr: CMake error when Log Management is enabled.

Open NZSmartie opened this issue 4 years ago • 0 comments

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

CONFIG_MCUMGR_CMD_LOG_MGMT=y

to the following file: https://github.com/apache/mynewt-mcumgr/blob/7658d09f1c6ee2b778390854a9d90d74b39e9fca/samples/smp_svr/zephyr/prj.conf#L34-L38

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. https://github.com/apache/mynewt-mcumgr/blob/7658d09f1c6ee2b778390854a9d90d74b39e9fca/cmd/log_mgmt/CMakeLists.txt#L18-L28

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 avatar Jun 13 '20 04:06 NZSmartie