From 31ed05377918500ef52b6deee14e05bf525038cc Mon Sep 17 00:00:00 2001 From: Shishir Dey Date: Mon, 30 Sep 2024 12:30:32 +0530 Subject: [PATCH 1/2] Remove coreMQTT logs --- config/core_mqtt_config.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/core_mqtt_config.h b/config/core_mqtt_config.h index 358388c..fe3a9ad 100644 --- a/config/core_mqtt_config.h +++ b/config/core_mqtt_config.h @@ -1,12 +1,6 @@ #ifndef CORE_MQTT_CONFIG_H #define CORE_MQTT_CONFIG_H -#include - -#define LogError(message) printf("Error: %s\n", message) -#define LogWarn(message) printf("Warning: %s\n", message) -#define LogInfo(message) printf("Info: %s\n", message) - #define MQTT_STATE_ARRAY_MAX_COUNT (10U) #define MQTT_MAX_CONNACK_RECEIVE_RETRY_COUNT (2U) From ec50f91e66428669d2c5a51c4009b5da3102a26b Mon Sep 17 00:00:00 2001 From: Shishir Dey Date: Mon, 30 Sep 2024 12:40:03 +0530 Subject: [PATCH 2/2] Add a conditional build to only build the examples if the Windows platform is detected --- CMakeLists.txt | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e48cb9..a85d401 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,38 +53,38 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build mbed TLS shared library.") add_subdirectory(external/mbedtls) target_link_libraries(bytebeam_firmware_sdk mbedtls mbedx509 mbedcrypto) -# examples/ +# Install rules for SDK and example +install(TARGETS bytebeam_firmware_sdk + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + PUBLIC_HEADER DESTINATION include +) + +# Build the examples if host is Windows if(WIN32) set(PLATFORM_SOURCES platform/Win32/platform_win32_port.c) + target_include_directories(bytebeam_firmware_sdk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/platform/Win32 ${CMAKE_CURRENT_SOURCE_DIR}/portable ${CMAKE_CURRENT_SOURCE_DIR}/include/bytebeam ) -else() - set(PLATFORM_SOURCES "") -endif() -# Create an example executable for bytebeam_stream_publish -add_executable(bytebeam_stream_publish - examples/bytebeam_stream_publish.c - ${PLATFORM_SOURCES} -) + add_executable(bytebeam_stream_publish + examples/bytebeam_stream_publish.c + ${PLATFORM_SOURCES} + ) -# Link the example with the SDK library -target_link_libraries(bytebeam_stream_publish bytebeam_firmware_sdk) + target_link_libraries(bytebeam_stream_publish bytebeam_firmware_sdk) -# Set the output directory for the example executable -set_target_properties(bytebeam_stream_publish PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples" -) + set_target_properties(bytebeam_stream_publish PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples" + ) -# Install rules for SDK and example -install(TARGETS bytebeam_firmware_sdk - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include -) -install(TARGETS bytebeam_stream_publish - RUNTIME DESTINATION bin -) + install(TARGETS bytebeam_stream_publish + RUNTIME DESTINATION bin + ) + +else() + set(PLATFORM_SOURCES "") +endif()