This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git

commit eb328cf9004c3afad402d9a56b6020eb66de5039
Author: Christopher Collins <ccoll...@apache.org>
AuthorDate: Tue Feb 13 11:37:34 2018 -0800

    Implicitly link sample zephyr app with mcumgr
    
    Whenever possible we want to avoid requiring the application to write
    build script code. To this end there exists support in the core build
    system to have libraries default to link with the app.
    
    This patch uses this mechanism to reduce the amount of documentation
    that an application developer needs to read and the amount of build
    script code that needs to be written.
---
 CMakeLists.txt                        |  2 +-
 Kconfig                               |  9 +++++++++
 README-zephyr.md                      | 13 +------------
 samples/smp_svr/README.md             |  1 -
 samples/smp_svr/zephyr/CMakeLists.txt |  1 -
 5 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b88b4ac..21ac645 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_library(MCUMGR INTERFACE)
+zephyr_interface_library_named(MCUMGR)
 
 zephyr_library()
 add_subdirectory(cborattr)
diff --git a/Kconfig b/Kconfig
index b4ff836..83eaeaa 100644
--- a/Kconfig
+++ b/Kconfig
@@ -26,4 +26,13 @@ config MCUMGR
 if MCUMGR
 source "ext/lib/mgmt/mcumgr/mgmt/port/zephyr/Kconfig"
 source "ext/lib/mgmt/mcumgr/cmd/Kconfig"
+
+config APP_LINK_WITH_MCUMGR
+       bool "Link 'app' with MCUMGR"
+       default y
+       help
+         Add MCUMGR header files to the 'app' include path. It may be
+         disabled if the include paths for MCUMGR are causing aliasing
+         issues for 'app'.
+
 endif
diff --git a/README-zephyr.md b/README-zephyr.md
index b808a2f..6c9581b 100644
--- a/README-zephyr.md
+++ b/README-zephyr.md
@@ -1,4 +1,4 @@
-## Building and using mcumgr with Zephyr
+## Using mcumgr with Zephyr
 
 ### Configuration
 
@@ -14,17 +14,6 @@ are described below:
 | `CONFIG_MCUMGR_CMD_LOG_MGMT` | Enable mcumgr handlers for log management | n 
|
 | `CONFIG_MCUMGR_CMD_OS_MGMT` | Enable mcumgr handlers for OS management | n |
 
-### Building
-
-Your application must specify mcumgr as a link-time dependency.  This is done
-by adding the following to your application's `CMakeLists.txt` file:
-
-```
-zephyr_link_libraries(
-    MCUMGR
-)
-```
-
 ### Known issues
 
 If the Bluetooth stack runs out of ACL transmit buffers while a large mcumgr 
response is being sent, the buffers never get freed.  This appears to trigger a 
net_buf leak in the stack.
diff --git a/samples/smp_svr/README.md b/samples/smp_svr/README.md
index 5e99d83..46e72a8 100644
--- a/samples/smp_svr/README.md
+++ b/samples/smp_svr/README.md
@@ -77,7 +77,6 @@ the `FLASH` and `FCB` settings:
 
 ```
     zephyr_link_libraries(
-        MCUMGR
         NFFS
     )
 ```
diff --git a/samples/smp_svr/zephyr/CMakeLists.txt 
b/samples/smp_svr/zephyr/CMakeLists.txt
index 0d5a485..cb73e5b 100644
--- a/samples/smp_svr/zephyr/CMakeLists.txt
+++ b/samples/smp_svr/zephyr/CMakeLists.txt
@@ -24,7 +24,6 @@ target_sources(app PRIVATE
 )
 
 zephyr_link_libraries(
-    MCUMGR
     NFFS
     mbedTLS
 )

-- 
To stop receiving notification emails like this one, please contact
ccoll...@apache.org.

Reply via email to