Skip to content

Commit ba5e360

Browse files
committed
cmake: Do initial network configuration if enabled
If CONFIG_NET_CONFIG_SETTINGS is enabled, then the network configuration library will check if a yaml file network-config.yaml is found in the application directory and use it to generate network initial configuration that is then applied when the device boots. If the yaml file is not there, then the relevant Kconfig options are used to create initial network configuration. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 5574488 commit ba5e360

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmake/modules/kernel.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,14 @@ if("${CMAKE_EXTRA_GENERATOR}" STREQUAL "Eclipse CDT4")
256256
include(${ZEPHYR_BASE}/cmake/ide/eclipse_cdt4_generator_amendment.cmake)
257257
eclipse_cdt4_generator_amendment(1)
258258
endif()
259+
260+
if(CONFIG_NET_CONFIG_SETTINGS)
261+
# If network configuration library is enabled, check if the yaml file
262+
# is present and use it to generate an initial configuration. Otherwise
263+
# use the .config file to generate the initial configuration.
264+
if(EXISTS ${APPLICATION_SOURCE_DIR}/network-config.yaml)
265+
network_generate_config_file_for_target(app ${APPLICATION_SOURCE_DIR}/network-config.yaml)
266+
else()
267+
network_generate_config_file_for_target(app ${DOTCONFIG})
268+
endif()
269+
endif()

0 commit comments

Comments
 (0)