diff --git a/easy_embedded/CMakeLists.txt b/easy_embedded/CMakeLists.txt index e334a07..afa3928 100755 --- a/easy_embedded/CMakeLists.txt +++ b/easy_embedded/CMakeLists.txt @@ -13,7 +13,7 @@ message(STATUS "**********************************************************") set(FRAMEWORK_ROOT_DIR ${CMAKE_SOURCE_DIR}/easy_embedded) - +option(BUILD_WITH_CMAKE "code base is built using CMake. Do not turn this OFF" ON) # Include -------------------------------------------------------------------- # Unused diff --git a/easy_embedded/app/CMakeLists.txt b/easy_embedded/app/CMakeLists.txt index 6653ef5..f435679 100755 --- a/easy_embedded/app/CMakeLists.txt +++ b/easy_embedded/app/CMakeLists.txt @@ -42,6 +42,8 @@ target_sources(ez_app_lib target_compile_definitions(ez_app_lib PUBLIC DATA_MODEL=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/app/data_model/CMakeLists.txt b/easy_embedded/app/data_model/CMakeLists.txt index 51b58a0..4959148 100644 --- a/easy_embedded/app/data_model/CMakeLists.txt +++ b/easy_embedded/app/data_model/CMakeLists.txt @@ -26,6 +26,8 @@ target_sources(ez_data_model_lib target_compile_definitions(ez_data_model_lib PUBLIC DATA_MODEL=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/app/data_model/ez_data_model.h b/easy_embedded/app/data_model/ez_data_model.h index 405dc53..dd57d59 100755 --- a/easy_embedded/app/data_model/ez_data_model.h +++ b/easy_embedded/app/data_model/ez_data_model.h @@ -30,8 +30,11 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ -#if (DATA_MODEL == 1U) +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif +#if (DATA_MODEL == 1U) #include #include #include "ez_utilities_common.h" diff --git a/easy_embedded/app/ipc/CMakeLists.txt b/easy_embedded/app/ipc/CMakeLists.txt index 6b03dcf..6c8aa2f 100644 --- a/easy_embedded/app/ipc/CMakeLists.txt +++ b/easy_embedded/app/ipc/CMakeLists.txt @@ -26,6 +26,8 @@ target_sources(ez_ipc_lib target_compile_definitions(ez_ipc_lib PUBLIC EZ_IPC_ENABLE=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/app/ipc/ez_ipc.h b/easy_embedded/app/ipc/ez_ipc.h index 5995e9e..4855e96 100644 --- a/easy_embedded/app/ipc/ez_ipc.h +++ b/easy_embedded/app/ipc/ez_ipc.h @@ -30,8 +30,11 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ -#if (EZ_IPC_ENABLE == 1) +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif +#if (EZ_IPC_ENABLE == 1) #include "stdint.h" #include "stdbool.h" diff --git a/easy_embedded/app/rpc/CMakeLists.txt b/easy_embedded/app/rpc/CMakeLists.txt index 778f111..5de43fc 100644 --- a/easy_embedded/app/rpc/CMakeLists.txt +++ b/easy_embedded/app/rpc/CMakeLists.txt @@ -26,6 +26,8 @@ target_sources(ez_rpc_lib target_compile_definitions(ez_rpc_lib PUBLIC EZ_RPC_ENABLE=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/app/rpc/ez_rpc.h b/easy_embedded/app/rpc/ez_rpc.h index 423351f..8f65a6b 100644 --- a/easy_embedded/app/rpc/ez_rpc.h +++ b/easy_embedded/app/rpc/ez_rpc.h @@ -30,6 +30,10 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + #if (EZ_RPC_ENABLE == 1) #include "stdint.h" #include "stdbool.h" diff --git a/easy_embedded/service/driver/CMakeLists.txt b/easy_embedded/service/driver/CMakeLists.txt index 5e2dc49..31f6b26 100644 --- a/easy_embedded/service/driver/CMakeLists.txt +++ b/easy_embedded/service/driver/CMakeLists.txt @@ -30,6 +30,7 @@ target_compile_definitions(ez_driver_lib PUBLIC EZ_DRIVER_ENABLE=$ EZ_UART_ENABLE=$ + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/service/driver/ez_driver_def.h b/easy_embedded/service/driver/ez_driver_def.h index c5d54bc..8cc0b73 100644 --- a/easy_embedded/service/driver/ez_driver_def.h +++ b/easy_embedded/service/driver/ez_driver_def.h @@ -30,6 +30,10 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + #if (EZ_DRIVER_ENABLE == 1) #include "stdint.h" #include "stdbool.h" diff --git a/easy_embedded/service/driver/uart/ez_uart.h b/easy_embedded/service/driver/uart/ez_uart.h index 8f7743e..0748334 100644 --- a/easy_embedded/service/driver/uart/ez_uart.h +++ b/easy_embedded/service/driver/uart/ez_uart.h @@ -32,6 +32,10 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + #if (EZ_UART_ENABLE == 1) #include #include diff --git a/easy_embedded/service/event_notifier/CMakeLists.txt b/easy_embedded/service/event_notifier/CMakeLists.txt index 8a9e734..f0fbaab 100644 --- a/easy_embedded/service/event_notifier/CMakeLists.txt +++ b/easy_embedded/service/event_notifier/CMakeLists.txt @@ -23,6 +23,8 @@ target_sources(ez_event_notifier_lib target_compile_definitions(ez_event_notifier_lib PUBLIC EZ_EVENT_NOTIFIER=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/service/event_notifier/ez_event_notifier.h b/easy_embedded/service/event_notifier/ez_event_notifier.h index ada275f..ded10a8 100755 --- a/easy_embedded/service/event_notifier/ez_event_notifier.h +++ b/easy_embedded/service/event_notifier/ez_event_notifier.h @@ -27,11 +27,15 @@ extern "C" { #endif -#if(EZ_EVENT_NOTIFIER == 1U) /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + +#if(EZ_EVENT_NOTIFIER == 1U) #include #include #include "ez_linked_list.h" diff --git a/easy_embedded/service/state_machine/CMakeLists.txt b/easy_embedded/service/state_machine/CMakeLists.txt index baf7ca3..80202e3 100644 --- a/easy_embedded/service/state_machine/CMakeLists.txt +++ b/easy_embedded/service/state_machine/CMakeLists.txt @@ -26,6 +26,8 @@ target_sources(ez_state_machine_lib target_compile_definitions(ez_state_machine_lib PUBLIC EZ_STATE_MACHINE_ENABLE=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/service/state_machine/ez_state_machine.h b/easy_embedded/service/state_machine/ez_state_machine.h index b5f562b..cb18ae1 100644 --- a/easy_embedded/service/state_machine/ez_state_machine.h +++ b/easy_embedded/service/state_machine/ez_state_machine.h @@ -30,12 +30,16 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + +#if (EZ_STATE_MACHINE_ENABLE == 1) + #include #include #include "ez_ring_buffer.h" -#if (EZ_STATE_MACHINE_ENABLE == 1) - /***************************************************************************** * Component Preprocessor Macros *****************************************************************************/ diff --git a/easy_embedded/service/task_worker/CMakeLists.txt b/easy_embedded/service/task_worker/CMakeLists.txt index daf05c1..7dcc0ca 100644 --- a/easy_embedded/service/task_worker/CMakeLists.txt +++ b/easy_embedded/service/task_worker/CMakeLists.txt @@ -30,6 +30,8 @@ target_compile_definitions(ez_task_worker_lib EZ_TASK_WORKER_ENABLE=$ EZ_THREADX_PORT_ENABLE=$ EZ_FREERTOS_PORT_ENABLE=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/service/task_worker/ez_task_worker.h b/easy_embedded/service/task_worker/ez_task_worker.h index 35f458b..4503ad2 100644 --- a/easy_embedded/service/task_worker/ez_task_worker.h +++ b/easy_embedded/service/task_worker/ez_task_worker.h @@ -30,6 +30,11 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + +#if (EZ_TASK_WORKER_ENABLE == 1) #include "ez_linked_list.h" #include "ez_queue.h" @@ -42,8 +47,6 @@ extern "C" { #include "event_groups.h" #endif -#if (EZ_TASK_WORKER_ENABLE == 1) - /***************************************************************************** * Component Preprocessor Macros *****************************************************************************/ diff --git a/easy_embedded/utilities/CMakeLists.txt b/easy_embedded/utilities/CMakeLists.txt index bcd2892..1691f8b 100644 --- a/easy_embedded/utilities/CMakeLists.txt +++ b/easy_embedded/utilities/CMakeLists.txt @@ -40,6 +40,8 @@ target_compile_definitions(ez_utilities_lib EZ_STATIC_ALLOC=$ EZ_SYS_ERROR=$ EZ_QUEUE=$ + PRIVATE + EZ_BUILD_WITH_CMAKE=$ ) diff --git a/easy_embedded/utilities/assert/ez_assert.h b/easy_embedded/utilities/assert/ez_assert.h index 9d6adc8..973093c 100755 --- a/easy_embedded/utilities/assert/ez_assert.h +++ b/easy_embedded/utilities/assert/ez_assert.h @@ -33,7 +33,9 @@ extern "C" { /******************************************************************************* * Includes *******************************************************************************/ -/*None*/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif /****************************************************************************** diff --git a/easy_embedded/utilities/queue/ez_queue.h b/easy_embedded/utilities/queue/ez_queue.h index 568ab4a..c6bdae4 100755 --- a/easy_embedded/utilities/queue/ez_queue.h +++ b/easy_embedded/utilities/queue/ez_queue.h @@ -30,6 +30,10 @@ extern "C" { /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + #if (EZ_QUEUE == 1U) #include #include "ez_utilities_common.h" diff --git a/easy_embedded/utilities/ring_buffer/ez_ring_buffer.h b/easy_embedded/utilities/ring_buffer/ez_ring_buffer.h index c4a6dfb..e9f177f 100755 --- a/easy_embedded/utilities/ring_buffer/ez_ring_buffer.h +++ b/easy_embedded/utilities/ring_buffer/ez_ring_buffer.h @@ -31,6 +31,10 @@ extern "C" { /******************************************************************************* * Includes *******************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + #include #include diff --git a/easy_embedded/utilities/static_alloc/ez_static_alloc.h b/easy_embedded/utilities/static_alloc/ez_static_alloc.h index 0839cd5..1f4636c 100755 --- a/easy_embedded/utilities/static_alloc/ez_static_alloc.h +++ b/easy_embedded/utilities/static_alloc/ez_static_alloc.h @@ -28,11 +28,16 @@ extern "C" { #endif -#if (EZ_STATIC_ALLOC == 1) /***************************************************************************** * Includes *****************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + +#if (EZ_STATIC_ALLOC == 1) + #include "stdint.h" #include "ez_linked_list.h" diff --git a/easy_embedded/utilities/system_error/ez_system_error.h b/easy_embedded/utilities/system_error/ez_system_error.h index 9c8f15f..731a8c6 100755 --- a/easy_embedded/utilities/system_error/ez_system_error.h +++ b/easy_embedded/utilities/system_error/ez_system_error.h @@ -35,11 +35,15 @@ extern "C" { #endif -#if (EZ_SYS_ERROR == 1U) /******************************************************************************* * Includes *******************************************************************************/ +#if (EZ_BUILD_WITH_CMAKE == 0U) +#include "ez_target_config.h" +#endif + +#if (EZ_SYS_ERROR == 1U) #include #include #include