diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f03c70eb2432..caf62b96c1e75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,6 +286,8 @@ endif() # @Intent: Set compiler specific macro inclusion of AUTOCONF_H zephyr_compile_options("SHELL: $ ${AUTOCONF_H}") +# @Intent: Set compiler specific macro inclusion of VERSION_H +zephyr_compile_options("SHELL: $ ${VERSION_H}") if(CONFIG_COMPILER_FREESTANDING) # @Intent: Set compiler specific flag for bare metal freestanding option @@ -552,16 +554,16 @@ if(ZEPHYR_GIT_INDEX) endif() add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/include/generated/version.h + OUTPUT ${VERSION_H} COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE} - -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/version.h + -DOUT_FILE=${VERSION_H} -DVERSION_TYPE=KERNEL -DVERSION_FILE=${ZEPHYR_BASE}/VERSION ${build_version_argument} -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake DEPENDS ${ZEPHYR_BASE}/VERSION ${git_dependency} ) -add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/version.h) +add_custom_target(version_h DEPENDS ${VERSION_H}) if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION) add_custom_command( @@ -1875,7 +1877,7 @@ if(log_dict_db_output) ${ZEPHYR_BASE}/scripts/logging/dictionary/database_gen.py ${KERNEL_ELF_NAME} ${log_dict_db_output} - --build-header ${PROJECT_BINARY_DIR}/include/generated/version.h + --build-header ${VERSION_H} ) list(APPEND post_build_byproducts diff --git a/boards/arm/arty/board.c b/boards/arm/arty/board.c index b2539d7aedd47..56479794c8a1d 100644 --- a/boards/arm/arty/board.c +++ b/boards/arm/arty/board.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ - +#include #include #include #include @@ -60,7 +60,11 @@ bool board_daplink_is_fitted(void) return !NVIC_GetPendingIRQ(DT_IRQN(DAPLINK_QSPI_MUX_NODE)); } +#if ZEPHYR_VERSION_CODE < ZEPHYR_VERSION(3, 4 , 0) +static int board_init(const struct device *arg) +#else static int board_init(void) +#endif { /* diff --git a/cmake/modules/version.cmake b/cmake/modules/version.cmake index b94bcf492b6de..9973dc005d9d3 100644 --- a/cmake/modules/version.cmake +++ b/cmake/modules/version.cmake @@ -119,3 +119,5 @@ foreach(type file IN ZIP_LISTS VERSION_TYPE VERSION_FILE) unset(PATCH) unset(${type}_VERSION_WITHOUT_TWEAK) endforeach() + +set(VERSION_H ${PROJECT_BINARY_DIR}/include/generated/version.h) diff --git a/kernel/banner.c b/kernel/banner.c index 689395292d502..3fd81facc88b6 100644 --- a/kernel/banner.c +++ b/kernel/banner.c @@ -7,7 +7,6 @@ #include #include #include -#include #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) #define DELAY_STR STRINGIFY(CONFIG_BOOT_DELAY) diff --git a/kernel/version.c b/kernel/version.c index 799e555f1aaa5..8063edeff7abd 100644 --- a/kernel/version.c +++ b/kernel/version.c @@ -5,13 +5,13 @@ */ #include -#include "version.h" /* generated by MAKE, at compile time */ +#include /** * @brief Return the kernel version of the present build * * The kernel version is a four-byte value, whose format is described in the - * file "kernel_version.h". + * file "version.h". * * @return kernel version */ diff --git a/lib/posix/uname.c b/lib/posix/uname.c index 107126f584ee1..56d57851782ff 100644 --- a/lib/posix/uname.c +++ b/lib/posix/uname.c @@ -4,7 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "version.h" #include #include #include diff --git a/samples/subsys/shell/shell_module/src/main.c b/samples/subsys/shell/shell_module/src/main.c index a3248cc7dc34e..46f4e10f79969 100644 --- a/samples/subsys/shell/shell_module/src/main.c +++ b/samples/subsys/shell/shell_module/src/main.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 92f1456bff4b9..5f2689f52fc90 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -8,7 +8,6 @@ #include #include -#include #include #include diff --git a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c index d98dc4e2b852b..d54f32d202537 100644 --- a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c @@ -32,7 +32,6 @@ #ifdef CONFIG_MCUMGR_GRP_OS_INFO #include -#include #include #include #if defined(CONFIG_NET_HOSTNAME_ENABLE) diff --git a/subsys/net/l2/openthread/openthread.c b/subsys/net/l2/openthread/openthread.c index d820e083d8b04..6c6e556258e42 100644 --- a/subsys/net/l2/openthread/openthread.c +++ b/subsys/net/l2/openthread/openthread.c @@ -19,7 +19,6 @@ LOG_MODULE_REGISTER(net_l2_openthread, CONFIG_OPENTHREAD_L2_LOG_LEVEL); #include #include #include -#include #include #include diff --git a/tests/kernel/common/src/main.c b/tests/kernel/common/src/main.c index e618d882094d4..6f354e0ad725f 100644 --- a/tests/kernel/common/src/main.c +++ b/tests/kernel/common/src/main.c @@ -8,7 +8,6 @@ #include #include #include -#include "version.h" /** * @defgroup kernel_common_tests Common Tests diff --git a/tests/subsys/mgmt/mcumgr/cb_notifications/src/main.c b/tests/subsys/mgmt/mcumgr/cb_notifications/src/main.c index db82847c6a991..02d3a616cabc9 100644 --- a/tests/subsys/mgmt/mcumgr/cb_notifications/src/main.c +++ b/tests/subsys/mgmt/mcumgr/cb_notifications/src/main.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include "smp_test_util.h" diff --git a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/build_date.c b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/build_date.c index 4af977895c317..34697100b1497 100644 --- a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/build_date.c +++ b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/build_date.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "smp_test_util.h" diff --git a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/limited.c b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/limited.c index f88997343514a..d28677f8f251a 100644 --- a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/limited.c +++ b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/limited.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include "smp_test_util.h" diff --git a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/main.c b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/main.c index 8ffc2a354b807..1045ef1243187 100644 --- a/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/main.c +++ b/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/main.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include "smp_test_util.h"