From 01edca858be6d9fbf622edad86e47835c32d8887 Mon Sep 17 00:00:00 2001 From: David Robson Date: Wed, 30 Nov 2016 15:47:40 -0800 Subject: [PATCH] All gateway public functions have been declared for export, gateway library is created as a DLL. All tests pass and samples run. Pulled in latest submodules, now I can build shared DLLs for iothub and C-shared. Gateway app can build with a relatively simple cmake file. Install the files in the binary dir, rather than making it a function. --- .gitignore | 3 +- .gitmodules | 6 +- CMakeLists.txt | 58 ++++++++++++++++--- bindings/dotnet/CMakeLists.txt | 2 +- .../dotnet/tests/dotnet_e2e/CMakeLists.txt | 1 + bindings/java/CMakeLists.txt | 2 +- bindings/nodejs/CMakeLists.txt | 2 +- .../nodejs/tests/nodejs_int/CMakeLists.txt | 5 ++ core/CMakeLists.txt | 21 ++++++- core/azure_iot_gateway_sdkConfig.cmake | 17 ++++++ core/inc/broker.h | 19 +++--- core/inc/experimental/event_system.h | 15 ++--- core/inc/gateway.h | 21 +++---- core/inc/gateway_export.h | 19 ++++++ core/inc/message.h | 19 +++--- core/inc/module_loaders/dotnet_loader.h | 3 +- core/inc/module_loaders/dynamic_loader.h | 3 +- core/inc/module_loaders/java_loader.h | 3 +- core/inc/module_loaders/node_loader.h | 3 +- core/tests/gateway_e2e/CMakeLists.txt | 15 ++--- core/tests/gateway_e2e/dependencies.cmake | 14 ++--- .../gateway_e2e/e2e_module/CMakeLists.txt | 1 + dependencies-test.cmake | 2 +- dependencies.cmake | 4 +- deps/CMakeLists.txt | 2 +- deps/c-utility | 2 +- deps/iot-sdk | 1 - deps/iot-sdk-c | 1 + deps/uamqp | 2 +- deps/umqtt | 2 +- jenkins/linux_c.sh | 2 +- jenkins/ubuntu1510_c.sh | 2 +- jenkins/windows_c.cmd | 2 +- modules/azure_functions/CMakeLists.txt | 2 +- modules/ble/CMakeLists.txt | 2 +- modules/ble/tests/ble_ut/CMakeLists.txt | 2 + modules/dependencies.cmake | 16 ++--- modules/identitymap/CMakeLists.txt | 2 +- modules/iothub/CMakeLists.txt | 2 +- modules/logger/CMakeLists.txt | 2 +- samples/azure_functions_sample/CMakeLists.txt | 2 + samples/ble_gateway/CMakeLists.txt | 2 + samples/dotnet_binding_sample/CMakeLists.txt | 1 + .../experimental/events_sample/CMakeLists.txt | 2 + samples/hello_world/CMakeLists.txt | 1 + samples/java_sample/CMakeLists.txt | 2 + samples/nodejs_simple_sample/CMakeLists.txt | 1 + .../CMakeLists.txt | 2 + .../src/azure-iot-field-gateway-sdk.bb | 4 +- tools/Dockerfile | 2 +- tools/build.cmd | 16 ++--- tools/build.sh | 10 ++-- tools/inteledison_c.sh | 2 +- tools/windriver_linux_c.sh | 2 +- 54 files changed, 239 insertions(+), 112 deletions(-) create mode 100644 core/inc/gateway_export.h delete mode 160000 deps/iot-sdk create mode 160000 deps/iot-sdk-c diff --git a/.gitignore b/.gitignore index ba7956db..679b9cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -220,4 +220,5 @@ browse.VC.db api_reference/ # install prefix -install-deps/ \ No newline at end of file +install-deps/ +Testing/Temporary/CTestCostData.txt diff --git a/.gitmodules b/.gitmodules index 7bc6be6d..646468ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "deps/azure-c-shared-utility"] path = deps/c-utility url = https://github.com/Azure/azure-c-shared-utility -[submodule "deps/azure-iot-sdks"] - path = deps/iot-sdk - url = https://github.com/azure/azure-iot-sdks [submodule "deps/parson"] path = deps/parson url = https://github.com/kgabis/parson @@ -25,3 +22,6 @@ [submodule "deps/umqtt"] path = deps/umqtt url = https://github.com/azure/azure-umqtt-c +[submodule "deps/iot-sdk-c"] + path = deps/iot-sdk-c + url = https://github.com/Azure/azure-iot-sdk-c.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b5b6b7dd..4dbd1fbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,13 @@ else() set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif() +# tests and samples should use pre-install path to gateway.so +set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${CMAKE_CURRENT_BINARY_DIR}/core/) + #the following variables are project-wide and can be used with cmake-gui -option(skip_unittests "set skip_unittests to ON to skip unittests (default is OFF)[if possible, they are always built]" OFF) -option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF) [if possible, they are always built]" OFF) +option(run_unittests "set run_unittests to ON to run unittests (default is OFF)" OFF) +option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF) " OFF) +option(nuget_e2e_tests "" OFF) option(install_executables "should cmake run cmake's install function (that includes dynamic link libraries) [it does for yocto]" OFF) option(install_modules "should cmake install the default gateway modules" OFF) option(enable_java_binding "set enable_java_binding to ON to enable building of Java binding (default is OFF)" OFF) @@ -51,6 +55,7 @@ option(use_amqp "set use_amqp to ON if amqp is to be used, set to OFF to not use option(use_http "set use_http to ON if http is to be used, set to OFF to not use http" ON) option(use_mqtt "set use_mqtt to ON if mqtt is to be used, set to OFF to not use mqtt" ON) + SET(use_condition ON CACHE BOOL "Build C shared utility with condition code" FORCE) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -120,11 +125,9 @@ endfunction() function(add_sample_to_solution sampleName) set_target_properties(${sampleName} PROPERTIES FOLDER "Samples") - #if(DEFINED ${dependency_install_prefix}) - set_target_properties(${sampleName} PROPERTIES - BUILD_WITH_INSTALL_RPATH TRUE - ) - #endif() + set_target_properties(${sampleName} PROPERTIES + BUILD_WITH_INSTALL_RPATH TRUE + ) endfunction() @@ -184,6 +187,46 @@ function(install_broker whatIsBuilding whatIsBuildingLocation) endif() endfunction(install_broker) +set(preinstall_gateway_library_dll ${CMAKE_CURRENT_BINARY_DIR}/core/$(Configuration)/gateway.dll) + +function(copy_gateway_dll whatIsBuilding whatIsBuildingLocation) + if(WIN32) + add_custom_command(TARGET ${whatIsBuilding} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${preinstall_gateway_library_dll} + ${whatIsBuildingLocation}) + if(EXISTS "${azure_c_shared_utility_DIR}/../bin/${SHARED_UTIL_LIB}.dll") + add_custom_command(TARGET ${whatIsBuilding} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${azure_c_shared_utility_DIR}/../bin/${SHARED_UTIL_LIB}.dll" + ${whatIsBuildingLocation}) + endif() + + + endif() +endfunction(copy_gateway_dll) + +function(copy_iothub_client_dll whatIsBuilding whatIsBuildingLocation) + if(WIN32) + if(EXISTS "${azure_iot_sdks_DIR}/../bin/iothub_client.dll") + add_custom_command(TARGET ${whatIsBuilding} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${azure_iot_sdks_DIR}/../bin/iothub_client.dll" + ${whatIsBuildingLocation}) + endif() + endif() +endfunction(copy_iothub_client_dll) + +function(copy_iothub_service_dll whatIsBuilding whatIsBuildingLocation) + if(WIN32) + if(EXISTS "${azure_iot_sdks_DIR}/../bin/iothub_service_client.dll") + add_custom_command(TARGET ${whatIsBuilding} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${azure_iot_sdks_DIR}/../bin/iothub_service_client.dll" + ${whatIsBuildingLocation}) + endif() + endif() +endfunction(copy_iothub_service_dll) if(${ARCHITECTURE} STREQUAL "x86_64") set(dotnet_managed_binding_dll ${CMAKE_CURRENT_BINARY_DIR}/../bindings/dotnet/dotnet-binding/Microsoft.Azure.IoT.Gateway/bin/x64/$(Configuration)/Microsoft.Azure.IoT.Gateway.dll CACHE INTERNAL "The location of the Microsoft.Azure.IoT.Gateway.dll (windows)" FORCE) @@ -193,6 +236,7 @@ if(${ARCHITECTURE} STREQUAL "x86_64") set(dotnet_sensor_module_dll ${CMAKE_CURRENT_BINARY_DIR}/../bindings/dotnet/dotnet-binding/SensorModule/bin/x64/$(Configuration)/SensorModule.dll CACHE INTERNAL "The location of the SensorModule.dll (windows)" FORCE) set(dotnet_printer_module_dll ${CMAKE_CURRENT_BINARY_DIR}/../bindings/dotnet/dotnet-binding/PrinterModule/bin/x64/$(Configuration)/PrinterModule.dll CACHE INTERNAL "The location of the PrinterModule.dll (windows)" FORCE) + elseif(${ARCHITECTURE} STREQUAL "x86") set(dotnet_managed_binding_dll ${CMAKE_CURRENT_BINARY_DIR}/../bindings/dotnet/dotnet-binding/Microsoft.Azure.IoT.Gateway/bin/x86/$(Configuration)/Microsoft.Azure.IoT.Gateway.dll CACHE INTERNAL "The location of the Microsoft.Azure.IoT.Gateway.dll (windows)" FORCE) diff --git a/bindings/dotnet/CMakeLists.txt b/bindings/dotnet/CMakeLists.txt index 3411da7c..b3f968be 100644 --- a/bindings/dotnet/CMakeLists.txt +++ b/bindings/dotnet/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(dotnet_static gateway mscoree) linkSharedUtil(dotnet) linkSharedUtil(dotnet_static) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/bindings/dotnet/tests/dotnet_e2e/CMakeLists.txt b/bindings/dotnet/tests/dotnet_e2e/CMakeLists.txt index 7652fffb..995fe042 100644 --- a/bindings/dotnet/tests/dotnet_e2e/CMakeLists.txt +++ b/bindings/dotnet/tests/dotnet_e2e/CMakeLists.txt @@ -45,6 +45,7 @@ if(TARGET ${theseTestsName}_exe) add_dependencies(${theseTestsName}_exe dotnet) install_broker(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + copy_gateway_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) install_binaries(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_managed_binding_dll} ) install_binaries(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_e2etest_module_dll} ) install_binaries(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_host_binding_dll} ) diff --git a/bindings/java/CMakeLists.txt b/bindings/java/CMakeLists.txt index 0c2b6fee..df24e1f2 100644 --- a/bindings/java/CMakeLists.txt +++ b/bindings/java/CMakeLists.txt @@ -89,7 +89,7 @@ linkSharedUtil(java_module_host_static) add_binding_to_solution(java_module_host) add_binding_to_solution(java_module_host_static) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/bindings/nodejs/CMakeLists.txt b/bindings/nodejs/CMakeLists.txt index 74f2b042..96c49842 100644 --- a/bindings/nodejs/CMakeLists.txt +++ b/bindings/nodejs/CMakeLists.txt @@ -132,7 +132,7 @@ target_include_directories(nodejs_binding_static PUBLIC $ENV{NODE_INCLUDE}) add_binding_to_solution(nodejs_binding) add_binding_to_solution(nodejs_binding_static) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/bindings/nodejs/tests/nodejs_int/CMakeLists.txt b/bindings/nodejs/tests/nodejs_int/CMakeLists.txt index a1152ed2..12287f86 100644 --- a/bindings/nodejs/tests/nodejs_int/CMakeLists.txt +++ b/bindings/nodejs/tests/nodejs_int/CMakeLists.txt @@ -37,6 +37,11 @@ target_link_libraries(${theseTestsName}_exe ${LIBS}) target_include_directories(nodejs_binding_static PUBLIC $ENV{NODE_INCLUDE}) install_broker(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) copy_node_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + +set_target_properties(${theseTestsName}_exe PROPERTIES + BUILD_WITH_INSTALL_RPATH TRUE +) if(WIN32) target_include_directories( diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index d9745275..b76bbcf1 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -77,10 +77,12 @@ set(gateway_h_sources ./inc/module_access.h ./inc/experimental/event_system.h ./inc/gateway.h + ./inc/gateway_export.h ./inc/gateway_version.h ./inc/module_loader.h ./inc/dynamic_library.h ./src/gateway_internal.h + ../deps/parson/parson.h ) # Add the module loaders @@ -140,31 +142,44 @@ endif() include_directories(./inc) -add_library(gateway +add_library(gateway SHARED + ${gateway_c_sources} + ${gateway_h_sources} +) + +add_library(gateway_static STATIC ${gateway_c_sources} ${gateway_h_sources} ) if(WIN32) target_link_libraries(gateway parson nanomsg aziotsharedutil ${dynamic_loader_library}) + target_link_libraries(gateway_static parson nanomsg aziotsharedutil ${dynamic_loader_library}) else() target_link_libraries(gateway parson nanomsg aziotsharedutil ${dynamic_loader_library}) target_link_libraries(gateway ${NN_REQUIRED_LIBRARIES}) target_link_libraries(gateway m) + + target_link_libraries(gateway_static parson nanomsg aziotsharedutil ${dynamic_loader_library}) + + target_link_libraries(gateway_static ${NN_REQUIRED_LIBRARIES}) + target_link_libraries(gateway_static m) endif() if(WIN32) target_link_libraries(gateway rpcrt4.lib) + target_link_libraries(gateway_static rpcrt4.lib) else() find_package(PkgConfig REQUIRED) pkg_search_module(UIDLINUX REQUIRED uuid) target_link_libraries(gateway uuid) + target_link_libraries(gateway_static uuid) endif() #this adds the tests to the build process -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() @@ -197,7 +212,7 @@ else() set(AIG_INCLUDE_DIRS ${AIG_HEADER_INSTALL_PREFIX}) endif() -install(TARGETS gateway EXPORT gatewayTargets +install(TARGETS gateway gateway_static EXPORT gatewayTargets LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${LIB_INSTALL_DIR}/../bin diff --git a/core/azure_iot_gateway_sdkConfig.cmake b/core/azure_iot_gateway_sdkConfig.cmake index 60e7649e..94ee3fc3 100644 --- a/core/azure_iot_gateway_sdkConfig.cmake +++ b/core/azure_iot_gateway_sdkConfig.cmake @@ -36,6 +36,23 @@ else() link_directories("${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif() +# install required gateway DLLs to current project +if (WIN32) + file( + INSTALL + "${azure_iot_gateway_sdk_DIR}/../bin/gateway.dll" + DESTINATION + "${CMAKE_CURRENT_BINARY_DIR}" + ) + + file( + INSTALL + "${azure_c_shared_utility_DIR}/../bin/aziotsharedutil.dll" + DESTINATION + "${CMAKE_CURRENT_BINARY_DIR}" + ) +endif() + link_directories("${CMAKE_CURRENT_LIST_DIR}/../lib") include("${CMAKE_CURRENT_LIST_DIR}/azure_iot_gateway_sdkTargets.cmake") \ No newline at end of file diff --git a/core/inc/broker.h b/core/inc/broker.h index 618038f7..799ff821 100644 --- a/core/inc/broker.h +++ b/core/inc/broker.h @@ -20,6 +20,7 @@ typedef struct BROKER_HANDLE_DATA_TAG* BROKER_HANDLE; #include "azure_c_shared_utility/macro_utils.h" #include "message.h" #include "module.h" +#include "gateway_export.h" #ifdef __cplusplus #include @@ -56,7 +57,7 @@ DEFINE_ENUM(BROKER_RESULT, BROKER_RESULT_VALUES); * * @return A valid #BROKER_HANDLE upon success, or @c NULL upon failure. */ -extern BROKER_HANDLE Broker_Create(void); +GATEWAY_EXPORT BROKER_HANDLE Broker_Create(void); /** @brief Increments the reference count of a message broker. * @@ -65,7 +66,7 @@ extern BROKER_HANDLE Broker_Create(void); * * @param broker The #BROKER_HANDLE to be cloned. */ -extern void Broker_IncRef(BROKER_HANDLE broker); +GATEWAY_EXPORT void Broker_IncRef(BROKER_HANDLE broker); /** @brief Decrements the reference count of a message broker. * @@ -75,7 +76,7 @@ extern void Broker_IncRef(BROKER_HANDLE broker); * * @param broker The #BROKER_HANDLE whose ref count will be decremented. */ -extern void Broker_DecRef(BROKER_HANDLE broker); +GATEWAY_EXPORT void Broker_DecRef(BROKER_HANDLE broker); /** @brief Publishes a message to the message broker. * @@ -93,7 +94,7 @@ extern void Broker_DecRef(BROKER_HANDLE broker); * * @return A #BROKER_RESULT describing the result of the function. */ -extern BROKER_RESULT Broker_Publish(BROKER_HANDLE broker, MODULE_HANDLE source, MESSAGE_HANDLE message); +GATEWAY_EXPORT BROKER_RESULT Broker_Publish(BROKER_HANDLE broker, MODULE_HANDLE source, MESSAGE_HANDLE message); /** @brief Adds a module to the message broker. * @@ -108,7 +109,7 @@ extern BROKER_RESULT Broker_Publish(BROKER_HANDLE broker, MODULE_HANDLE source, * * @return A #BROKER_RESULT describing the result of the function. */ -extern BROKER_RESULT Broker_AddModule(BROKER_HANDLE broker, const MODULE* module); +GATEWAY_EXPORT BROKER_RESULT Broker_AddModule(BROKER_HANDLE broker, const MODULE* module); /** @brief Removes a module from the message broker. * @@ -117,7 +118,7 @@ extern BROKER_RESULT Broker_AddModule(BROKER_HANDLE broker, const MODULE* module * * @return A #BROKER_RESULT describing the result of the function. */ -extern BROKER_RESULT Broker_RemoveModule(BROKER_HANDLE broker, const MODULE* module); +GATEWAY_EXPORT BROKER_RESULT Broker_RemoveModule(BROKER_HANDLE broker, const MODULE* module); /** @brief Adds a route to the message broker. * @@ -132,7 +133,7 @@ extern BROKER_RESULT Broker_RemoveModule(BROKER_HANDLE broker, const MODULE* mod * * @return A #BROKER_RESULT describing the result of the function. */ -extern BROKER_RESULT Broker_AddLink(BROKER_HANDLE broker, const BROKER_LINK_DATA* link); +GATEWAY_EXPORT BROKER_RESULT Broker_AddLink(BROKER_HANDLE broker, const BROKER_LINK_DATA* link); /** @brief Removes a route from the message broker. * @@ -141,13 +142,13 @@ extern BROKER_RESULT Broker_AddLink(BROKER_HANDLE broker, const BROKER_LINK_DATA * * @return A #BROKER_RESULT describing the result of the function. */ -extern BROKER_RESULT Broker_RemoveLink(BROKER_HANDLE broker, const BROKER_LINK_DATA* link); +GATEWAY_EXPORT BROKER_RESULT Broker_RemoveLink(BROKER_HANDLE broker, const BROKER_LINK_DATA* link); /** @brief Disposes of resources allocated by a message broker. * * @param broker The #BROKER_HANDLE to be destroyed. */ -extern void Broker_Destroy(BROKER_HANDLE broker); +GATEWAY_EXPORT void Broker_Destroy(BROKER_HANDLE broker); #ifdef __cplusplus } diff --git a/core/inc/experimental/event_system.h b/core/inc/experimental/event_system.h index 39cca52a..7d15cfb3 100644 --- a/core/inc/experimental/event_system.h +++ b/core/inc/experimental/event_system.h @@ -9,6 +9,7 @@ #define EVENT_SYSTEM_H #include "gateway.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -72,10 +73,10 @@ typedef void* GATEWAY_EVENT_CTX; */ typedef void(*GATEWAY_CALLBACK)(GATEWAY_HANDLE gateway, GATEWAY_EVENT event_type, GATEWAY_EVENT_CTX context, void* user_param); -extern EVENTSYSTEM_HANDLE EventSystem_Init(void); -extern void EventSystem_AddEventCallback(EVENTSYSTEM_HANDLE event_system, GATEWAY_EVENT event_type, GATEWAY_CALLBACK callback, void* user_param); -extern void EventSystem_ReportEvent(EVENTSYSTEM_HANDLE event_system, GATEWAY_HANDLE gw, GATEWAY_EVENT event_type); -extern void EventSystem_Destroy(EVENTSYSTEM_HANDLE event_system); +GATEWAY_EXPORT EVENTSYSTEM_HANDLE EventSystem_Init(void); +GATEWAY_EXPORT void EventSystem_AddEventCallback(EVENTSYSTEM_HANDLE event_system, GATEWAY_EVENT event_type, GATEWAY_CALLBACK callback, void* user_param); +GATEWAY_EXPORT void EventSystem_ReportEvent(EVENTSYSTEM_HANDLE event_system, GATEWAY_HANDLE gw, GATEWAY_EVENT event_type); +GATEWAY_EXPORT void EventSystem_Destroy(EVENTSYSTEM_HANDLE event_system); /** @brief Registers a function to be called on a callback thread when_all * #GATEWAY_EVENT happens @@ -89,7 +90,7 @@ extern void EventSystem_Destroy(EVENTSYSTEM_HANDLE event_system); * @param user_param User defined parameter that will be later provided * to the called callback */ -extern void Gateway_AddEventCallback(GATEWAY_HANDLE gw, GATEWAY_EVENT event_type, GATEWAY_CALLBACK callback, void* user_param); +GATEWAY_EXPORT void Gateway_AddEventCallback(GATEWAY_HANDLE gw, GATEWAY_EVENT event_type, GATEWAY_CALLBACK callback, void* user_param); /** @brief Returns a snapshot copy of information about running modules. * @@ -103,14 +104,14 @@ extern void Gateway_AddEventCallback(GATEWAY_HANDLE gw, GATEWAY_EVENT event_type * @return A #VECTOR_HANDLE of pointers to #GATEWAY_MODULE_INFO on success. * NULL on failure. */ -extern VECTOR_HANDLE Gateway_GetModuleList(GATEWAY_HANDLE gw); +GATEWAY_EXPORT VECTOR_HANDLE Gateway_GetModuleList(GATEWAY_HANDLE gw); /** @brief Destroys the list returned by @c Gateway_GetModuleList * * @param module_list A vector handle as returned from * @c Gateway_GetModuleList */ -extern void Gateway_DestroyModuleList(VECTOR_HANDLE module_list); +GATEWAY_EXPORT void Gateway_DestroyModuleList(VECTOR_HANDLE module_list); #ifdef __cplusplus } diff --git a/core/inc/gateway.h b/core/inc/gateway.h index 45f80f38..822d8264 100644 --- a/core/inc/gateway.h +++ b/core/inc/gateway.h @@ -15,6 +15,7 @@ #include "azure_c_shared_utility/vector.h" #include "module.h" #include "module_loader.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -143,7 +144,7 @@ typedef struct GATEWAY_PROPERTIES_DATA_TAG * @return A non-NULL #GATEWAY_HANDLE that can be used to manage the * gateway or @c NULL on failure. */ -extern GATEWAY_HANDLE Gateway_CreateFromJson(const char* file_path); +GATEWAY_EXPORT GATEWAY_HANDLE Gateway_CreateFromJson(const char* file_path); /** @brief Creates a new gateway using the provided #GATEWAY_PROPERTIES. * @@ -153,7 +154,7 @@ extern GATEWAY_HANDLE Gateway_CreateFromJson(const char* file_path); * @return A non-NULL #GATEWAY_HANDLE that can be used to manage the * gateway or @c NULL on failure. */ -extern GATEWAY_HANDLE Gateway_Create(const GATEWAY_PROPERTIES* properties); +GATEWAY_EXPORT GATEWAY_HANDLE Gateway_Create(const GATEWAY_PROPERTIES* properties); /** @brief Tell the Gateway it's ready to start. * @@ -161,13 +162,13 @@ extern GATEWAY_HANDLE Gateway_Create(const GATEWAY_PROPERTIES* properties); * * @return A #GATEWAY_START_RESULT to report the result of the start */ -extern GATEWAY_START_RESULT Gateway_Start(GATEWAY_HANDLE gw); +GATEWAY_EXPORT GATEWAY_START_RESULT Gateway_Start(GATEWAY_HANDLE gw); /** @brief Destroys the gateway and disposes of all associated data. * * @param gw #GATEWAY_HANDLE to be destroyed. */ -extern void Gateway_Destroy(GATEWAY_HANDLE gw); +GATEWAY_EXPORT void Gateway_Destroy(GATEWAY_HANDLE gw); /** @brief Creates a new module based on the GATEWAY_MODULES_ENTRY*. * @@ -178,7 +179,7 @@ extern void Gateway_Destroy(GATEWAY_HANDLE gw); * @return A non-NULL #MODULE_HANDLE to the newly created and added * Module, or @c NULL on failure. */ -extern MODULE_HANDLE Gateway_AddModule(GATEWAY_HANDLE gw, const GATEWAY_MODULES_ENTRY* entry); +GATEWAY_EXPORT MODULE_HANDLE Gateway_AddModule(GATEWAY_HANDLE gw, const GATEWAY_MODULES_ENTRY* entry); /** @brief Tells a module that the gateway is ready for it to start. * @@ -186,7 +187,7 @@ extern MODULE_HANDLE Gateway_AddModule(GATEWAY_HANDLE gw, const GATEWAY_MODULES_ * Module. * @param module Pointer to a #MODULE_HANDLE that needs to be removed. */ -extern void Gateway_StartModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); +GATEWAY_EXPORT void Gateway_StartModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); /** @brief Removes the provided module from the gateway and all links that @@ -196,7 +197,7 @@ extern void Gateway_StartModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); * Module. * @param module Pointer to a #MODULE_HANDLE that needs to be removed. */ -extern void Gateway_RemoveModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); +GATEWAY_EXPORT void Gateway_RemoveModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); /** @brief Removes module by its unique name * @@ -207,7 +208,7 @@ extern void Gateway_RemoveModule(GATEWAY_HANDLE gw, MODULE_HANDLE module); * * @return 0 on success and a non-zero value when an error occurs. */ -extern int Gateway_RemoveModuleByName(GATEWAY_HANDLE gw, const char *module_name); +GATEWAY_EXPORT int Gateway_RemoveModuleByName(GATEWAY_HANDLE gw, const char *module_name); /** @brief Adds a link to a gateway message broker. * @@ -218,7 +219,7 @@ extern int Gateway_RemoveModuleByName(GATEWAY_HANDLE gw, const char *module_name * * @return A GATEWAY_ADD_LINK_RESULT with the operation result. */ -extern GATEWAY_ADD_LINK_RESULT Gateway_AddLink(GATEWAY_HANDLE gw, const GATEWAY_LINK_ENTRY* entryLink); +GATEWAY_EXPORT GATEWAY_ADD_LINK_RESULT Gateway_AddLink(GATEWAY_HANDLE gw, const GATEWAY_LINK_ENTRY* entryLink); /** @brief Remove a link from a gateway message broker. * @@ -227,7 +228,7 @@ extern GATEWAY_ADD_LINK_RESULT Gateway_AddLink(GATEWAY_HANDLE gw, const GATEWAY_ * * @param entryLink Pointer to a #GATEWAY_LINK_ENTRY to be removed. */ -extern void Gateway_RemoveLink(GATEWAY_HANDLE gw, const GATEWAY_LINK_ENTRY* entryLink); +GATEWAY_EXPORT void Gateway_RemoveLink(GATEWAY_HANDLE gw, const GATEWAY_LINK_ENTRY* entryLink); #ifdef __cplusplus } diff --git a/core/inc/gateway_export.h b/core/inc/gateway_export.h new file mode 100644 index 00000000..2be543a6 --- /dev/null +++ b/core/inc/gateway_export.h @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +/** @file gateway_export.h + * @brief Defines the appropriate function export. + * + * @details Architecture dependent function declarations. + */ + +#ifndef GATEWAY_EXPORT_H +#define GATEWAY_EXPORT_H + +#ifdef _WIN32 +#define GATEWAY_EXPORT __declspec(dllexport) +#else +#define GATEWAY_EXPORT extern +#endif // _WIN32 + +#endif // GATEWAY_EXPORT_H diff --git a/core/inc/message.h b/core/inc/message.h index e305a2c0..9ec12768 100644 --- a/core/inc/message.h +++ b/core/inc/message.h @@ -30,6 +30,7 @@ #include "azure_c_shared_utility/map.h" #include "azure_c_shared_utility/constmap.h" #include "azure_c_shared_utility/constbuffer.h" +#include "gateway_export.h" #ifdef __cplusplus #include @@ -98,7 +99,7 @@ typedef struct MESSAGE_BUFFER_CONFIG_TAG * @return A non-NULL #MESSAGE_HANDLE for the newly created message, or * NULL upon failure. */ -extern MESSAGE_HANDLE Message_Create(const MESSAGE_CONFIG* cfg); +GATEWAY_EXPORT MESSAGE_HANDLE Message_Create(const MESSAGE_CONFIG* cfg); /** @brief Creates a new reference counted message from a byte array * containing the serialized form of a message. @@ -112,7 +113,7 @@ extern MESSAGE_HANDLE Message_Create(const MESSAGE_CONFIG* cfg); * @return A non-NULL #MESSAGE_HANDLE for the newly created message, or * NULL upon failure. */ -extern MESSAGE_HANDLE Message_CreateFromByteArray(const unsigned char* source, int32_t size); +GATEWAY_EXPORT MESSAGE_HANDLE Message_CreateFromByteArray(const unsigned char* source, int32_t size); /** @brief Creates a byte array representation of a MESSAGE_HANDLE. * @@ -129,7 +130,7 @@ extern MESSAGE_HANDLE Message_CreateFromByteArray(const unsigned char* source, i * size required for a full successful serialization. Returns a * negative value when an error occurs. */ -extern int32_t Message_ToByteArray(MESSAGE_HANDLE messageHandle, unsigned char* buf, int32_t size); +GATEWAY_EXPORT int32_t Message_ToByteArray(MESSAGE_HANDLE messageHandle, unsigned char* buf, int32_t size); /** @brief Creates a new message from a @c CONSTBUFFER source and * @c MAP_HANDLE. @@ -146,7 +147,7 @@ extern int32_t Message_ToByteArray(MESSAGE_HANDLE messageHandle, unsigned char* * @return A non-NULL #MESSAGE_HANDLE for the newly created message, or * @c NULL upon failure. */ -extern MESSAGE_HANDLE Message_CreateFromBuffer(const MESSAGE_BUFFER_CONFIG* cfg); +GATEWAY_EXPORT MESSAGE_HANDLE Message_CreateFromBuffer(const MESSAGE_BUFFER_CONFIG* cfg); /** @brief Creates a clone of the message. * @@ -158,7 +159,7 @@ extern MESSAGE_HANDLE Message_CreateFromBuffer(const MESSAGE_BUFFER_CONFIG* cfg) * @return A non-NULL #MESSAGE_HANDLE cloned from @c message, or @c NULL * upon failure. */ -extern MESSAGE_HANDLE Message_Clone(MESSAGE_HANDLE message); +GATEWAY_EXPORT MESSAGE_HANDLE Message_Clone(MESSAGE_HANDLE message); /** @brief Gets the properties of a message. * @@ -172,7 +173,7 @@ extern MESSAGE_HANDLE Message_Clone(MESSAGE_HANDLE message); * message, or @c NULL upon failure. * */ -extern CONSTMAP_HANDLE Message_GetProperties(MESSAGE_HANDLE message); +GATEWAY_EXPORT CONSTMAP_HANDLE Message_GetProperties(MESSAGE_HANDLE message); /** @brief Gets the content of a message. * @@ -184,7 +185,7 @@ extern CONSTMAP_HANDLE Message_GetProperties(MESSAGE_HANDLE message); * @return A non-NULL pointer to a @c CONSTBUFFER representing the content * of the message, or @c NULL upon failure. */ -extern const CONSTBUFFER* Message_GetContent(MESSAGE_HANDLE message); +GATEWAY_EXPORT const CONSTBUFFER* Message_GetContent(MESSAGE_HANDLE message); /** @brief Gets the @c CONSTBUFFER handle that may be used to access the * message content. @@ -197,13 +198,13 @@ extern const CONSTBUFFER* Message_GetContent(MESSAGE_HANDLE message); * @return A non-NULL @c CONSTBUFFER_HANDLE representing the message * content, or @c NULL upon failure. */ -extern CONSTBUFFER_HANDLE Message_GetContentHandle(MESSAGE_HANDLE message); +GATEWAY_EXPORT CONSTBUFFER_HANDLE Message_GetContentHandle(MESSAGE_HANDLE message); /** @brief Disposes of resources allocated by the message. * * @param message The #MESSAGE_HANDLE to be destroyed. */ -extern void Message_Destroy(MESSAGE_HANDLE message); +GATEWAY_EXPORT void Message_Destroy(MESSAGE_HANDLE message); #ifdef __cplusplus } diff --git a/core/inc/module_loaders/dotnet_loader.h b/core/inc/module_loaders/dotnet_loader.h index d10a5f78..0d0ecf8a 100644 --- a/core/inc/module_loaders/dotnet_loader.h +++ b/core/inc/module_loaders/dotnet_loader.h @@ -9,6 +9,7 @@ #include "module.h" #include "module_loader.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -31,7 +32,7 @@ typedef struct DOTNET_LOADER_ENTRYPOINT_TAG STRING_HANDLE dotnetModuleEntryClass; } DOTNET_LOADER_ENTRYPOINT; -MOCKABLE_FUNCTION(, const MODULE_LOADER*, DotnetLoader_Get); +MOCKABLE_FUNCTION(, GATEWAY_EXPORT const MODULE_LOADER*, DotnetLoader_Get); #ifdef __cplusplus } diff --git a/core/inc/module_loaders/dynamic_loader.h b/core/inc/module_loaders/dynamic_loader.h index 2a0490e2..a4d47fc6 100644 --- a/core/inc/module_loaders/dynamic_loader.h +++ b/core/inc/module_loaders/dynamic_loader.h @@ -17,6 +17,7 @@ #include "module.h" #include "module_loader.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -33,7 +34,7 @@ typedef struct DYNAMIC_LOADER_ENTRYPOINT_TAG } DYNAMIC_LOADER_ENTRYPOINT; /** @brief The API for the dynamically linked module loader. */ -MOCKABLE_FUNCTION(, const MODULE_LOADER*, DynamicLoader_Get); +MOCKABLE_FUNCTION(, GATEWAY_EXPORT const MODULE_LOADER*, DynamicLoader_Get); #ifdef __cplusplus } diff --git a/core/inc/module_loaders/java_loader.h b/core/inc/module_loaders/java_loader.h index a04dd42d..fcc11e91 100644 --- a/core/inc/module_loaders/java_loader.h +++ b/core/inc/module_loaders/java_loader.h @@ -11,6 +11,7 @@ #include "module_loader.h" #include "java_module_host.h" #include "gateway_version.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -74,7 +75,7 @@ typedef struct JAVA_LOADER_ENTRYPOINT_TAG STRING_HANDLE classPath; } JAVA_LOADER_ENTRYPOINT; -MOCKABLE_FUNCTION(, const MODULE_LOADER*, JavaLoader_Get); +MOCKABLE_FUNCTION(, GATEWAY_EXPORT const MODULE_LOADER*, JavaLoader_Get); #ifdef __cplusplus } diff --git a/core/inc/module_loaders/node_loader.h b/core/inc/module_loaders/node_loader.h index 5cc0034b..f9a6e549 100644 --- a/core/inc/module_loaders/node_loader.h +++ b/core/inc/module_loaders/node_loader.h @@ -9,6 +9,7 @@ #include "module.h" #include "module_loader.h" +#include "gateway_export.h" #ifdef __cplusplus extern "C" @@ -28,7 +29,7 @@ typedef struct NODE_LOADER_ENTRYPOINT_TAG STRING_HANDLE mainPath; } NODE_LOADER_ENTRYPOINT; -MOCKABLE_FUNCTION(, const MODULE_LOADER*, NodeLoader_Get); +MOCKABLE_FUNCTION(, GATEWAY_EXPORT const MODULE_LOADER*, NodeLoader_Get); #ifdef __cplusplus } diff --git a/core/tests/gateway_e2e/CMakeLists.txt b/core/tests/gateway_e2e/CMakeLists.txt index ebc7e5e0..a24db80d 100644 --- a/core/tests/gateway_e2e/CMakeLists.txt +++ b/core/tests/gateway_e2e/CMakeLists.txt @@ -26,7 +26,7 @@ set(${theseTestsName}_c_files ) include_directories(../../../samples/protocol_encapsulation/inc ${IOTHUB_CLIENT_INC_FOLDER} e2e_module/inc/) -include_directories(../../../deps/iot-sdk/c/testtools/iothub_test/inc) +include_directories(../../../deps/iot-sdk-c/testtools/iothub_test/inc) include_directories(../../../deps/c-utility/inc/azure_c_shared_utility) include_directories(../../../modules/common) include_directories(../../../modules/iothub/inc) @@ -36,12 +36,10 @@ include_directories(${IOTHUB_SERVICE_CLIENT_INC_FOLDER}) include_directories(${GW_INC}) build_test_artifacts(${theseTestsName} ON) -if(DEFINED ${dependency_install_prefix}) - set_target_properties( - ${theseTestsName}_exe PROPERTIES - BUILD_WITH_INSTALL_RPATH TRUE - ) -endif() +set_target_properties( + ${theseTestsName}_exe PROPERTIES + BUILD_WITH_INSTALL_RPATH TRUE +) if(WIN32) if(TARGET ${theseTestsName}_dll) @@ -61,6 +59,9 @@ if(WIN32) iothub_client_http_transport ) install_broker(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + copy_gateway_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + copy_iothub_client_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration)) + copy_iothub_service_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration)) endif() else() if(TARGET ${theseTestsName}_exe) diff --git a/core/tests/gateway_e2e/dependencies.cmake b/core/tests/gateway_e2e/dependencies.cmake index 623a017d..699684cf 100644 --- a/core/tests/gateway_e2e/dependencies.cmake +++ b/core/tests/gateway_e2e/dependencies.cmake @@ -6,18 +6,18 @@ include("../../../gatewayFunctions.cmake") ############################################################################### ###########################Find/Install/Build uamqp############################ ############################################################################### -findAndInstall(uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp -Duse_installed_dependencies=ON -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") ############################################################################### ###########################Find/Install/Build umqtt############################ ############################################################################### -findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt -Duse_installed_dependencies=ON -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") ############################################################################### #######################Find/Install/Build azure_iot_sdks####################### ############################################################################### #The azure_iot_sdks repo requires special treatment. Parson submodule must be initialized. -if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c/parson/README.md) +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c/parson/README.md) execute_process( COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/iot-sdk WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} @@ -25,15 +25,15 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c/parson/README.md) ) if(${res}) - message(FATAL_ERROR "Error pulling iot-sdk submodule: ${res}") + message(FATAL_ERROR "Error pulling iot-sdk-c submodule: ${res}") endif() execute_process( - COMMAND git submodule update --init c/parson - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk + COMMAND git submodule update --init parson + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c RESULT_VARIABLE res ) if(${res}) message(FATAL_ERROR "Error pulling parson submodule: ${res}") endif() endif() -findAndInstall(azure_iot_sdks ${PROJECT_SOURCE_DIR}/deps/iot-sdk ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c -Duse_installed_dependencies=ON -Drun_e2e_tests=ON -Duse_openssl=OFF -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(azure_iot_sdks ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c -Duse_installed_dependencies=ON -Dbuild_as_shared=ON -Drun_e2e_tests=ON -Duse_openssl=OFF -G "${CMAKE_GENERATOR}") diff --git a/core/tests/gateway_e2e/e2e_module/CMakeLists.txt b/core/tests/gateway_e2e/e2e_module/CMakeLists.txt index 3982e7a9..3391bd3a 100644 --- a/core/tests/gateway_e2e/e2e_module/CMakeLists.txt +++ b/core/tests/gateway_e2e/e2e_module/CMakeLists.txt @@ -19,3 +19,4 @@ add_library(e2e_module MODULE ${e2e_module_sources} ${e2e_module_headers}) target_link_libraries(e2e_module gateway) linkSharedUtil(e2e_module) + diff --git a/dependencies-test.cmake b/dependencies-test.cmake index 08b5d892..6b16d4dc 100644 --- a/dependencies-test.cmake +++ b/dependencies-test.cmake @@ -16,4 +16,4 @@ findAndInstall(testrunnerswitcher ${PROJECT_SOURCE_DIR}/deps/testrunner ${PROJEC ############################################################################### ###########################Find/Install/Build umock############################ ############################################################################### -findAndInstall(umock_c ${PROJECT_SOURCE_DIR}/deps/umock-c ${PROJECT_SOURCE_DIR}/deps/umock-c -Duse_installed_dependencies=ON -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") \ No newline at end of file +findAndInstall(umock_c ${PROJECT_SOURCE_DIR}/deps/umock-c ${PROJECT_SOURCE_DIR}/deps/umock-c -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") \ No newline at end of file diff --git a/dependencies.cmake b/dependencies.cmake index 27f4dc1c..afcba14a 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -10,7 +10,7 @@ include("gatewayFunctions.cmake") ############################################################################### ###################Find/Install/Build azure_c_shared_utility################### ############################################################################### -findAndInstall(azure_c_shared_utility ${PROJECT_SOURCE_DIR}/deps/c-utility ${PROJECT_SOURCE_DIR}/deps/c-utility -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") +findAndInstall(azure_c_shared_utility ${PROJECT_SOURCE_DIR}/deps/c-utility ${PROJECT_SOURCE_DIR}/deps/c-utility -Duse_installed_dependencies=ON -Drun_unittests=${run_unittests} -Dbuild_as_dynamic=ON -G "${CMAKE_GENERATOR}") set(SHARED_UTIL_INC_FOLDER ${AZURE_C_SHARED_UTILITY_INCLUDE_DIR} CACHE INTERNAL "this is what needs to be included if using sharedLib lib" FORCE) set(SHARED_UTIL_LIB_FOLDER ${AZURE_C_SHARED_LIBRARY_DIR} CACHE INTERNAL "this is what needs to be included if using sharedLib lib" FORCE) set(SHARED_UTIL_LIB aziotsharedutil CACHE INTERNAL "this is what needs to be included if using sharedLib lib" FORCE) @@ -92,4 +92,4 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/parson/parson.c) if(${res}) message(FATAL_ERROR "Error pulling parson submodule: ${res}") endif() -endif() \ No newline at end of file +endif() diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 753e3b5a..0f19693a 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -7,4 +7,4 @@ cmake_minimum_required(VERSION 2.8.11) set(run_valgrind OFF) add_subdirectory(./c-utility) -add_subdirectory(./iot-sdk/c) +add_subdirectory(./iot-sdk-c) diff --git a/deps/c-utility b/deps/c-utility index e8f4077b..555a5ba5 160000 --- a/deps/c-utility +++ b/deps/c-utility @@ -1 +1 @@ -Subproject commit e8f4077bdb7c8fbdfe2df7c9e90297e22a9c6708 +Subproject commit 555a5ba578bd7452c1272e9615a97c398c6e64be diff --git a/deps/iot-sdk b/deps/iot-sdk deleted file mode 160000 index 5b3a502b..00000000 --- a/deps/iot-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b3a502b9c0f15df138e9402d9a0505663ac795f diff --git a/deps/iot-sdk-c b/deps/iot-sdk-c new file mode 160000 index 00000000..a08640f4 --- /dev/null +++ b/deps/iot-sdk-c @@ -0,0 +1 @@ +Subproject commit a08640f4390f65cd8d51d8f435aaed7fd2cc401e diff --git a/deps/uamqp b/deps/uamqp index 6f1288aa..b9df6c69 160000 --- a/deps/uamqp +++ b/deps/uamqp @@ -1 +1 @@ -Subproject commit 6f1288aaaf53c601c75e6ab084065b3e65ded1fe +Subproject commit b9df6c6928b12964fecd54bb318801ad9348eb1f diff --git a/deps/umqtt b/deps/umqtt index 08d8e081..44fafa85 160000 --- a/deps/umqtt +++ b/deps/umqtt @@ -1 +1 @@ -Subproject commit 08d8e081aecb3c33d5ed20447c38dabe81f64e26 +Subproject commit 44fafa85c0cec778315aa896994bf2630de198bb diff --git a/jenkins/linux_c.sh b/jenkins/linux_c.sh index 90565ced..93c245fe 100755 --- a/jenkins/linux_c.sh +++ b/jenkins/linux_c.sh @@ -6,6 +6,6 @@ build_root=$(cd "$(dirname "$0")/.." && pwd) cd $build_root # -- C -- -./tools/build.sh --enable-nodejs-binding --enable-java-binding "$@" #-x +./tools/build.sh --run-unittests --enable-nodejs-binding --enable-java-binding "$@" #-x [ $? -eq 0 ] || exit $? \ No newline at end of file diff --git a/jenkins/ubuntu1510_c.sh b/jenkins/ubuntu1510_c.sh index 90565ced..93c245fe 100755 --- a/jenkins/ubuntu1510_c.sh +++ b/jenkins/ubuntu1510_c.sh @@ -6,6 +6,6 @@ build_root=$(cd "$(dirname "$0")/.." && pwd) cd $build_root # -- C -- -./tools/build.sh --enable-nodejs-binding --enable-java-binding "$@" #-x +./tools/build.sh --run-unittests --enable-nodejs-binding --enable-java-binding "$@" #-x [ $? -eq 0 ] || exit $? \ No newline at end of file diff --git a/jenkins/windows_c.cmd b/jenkins/windows_c.cmd index 06717745..b02492c1 100644 --- a/jenkins/windows_c.cmd +++ b/jenkins/windows_c.cmd @@ -44,7 +44,7 @@ REM -- Build first dotnet binding for End2End Test. call build_dotnet.cmd %* if errorlevel 1 goto :reset-java -call build.cmd --run-e2e-tests --enable-nodejs-binding --enable-dotnet-binding --enable-java-binding %* +call build.cmd --run-unittests --run-e2e-tests --enable-nodejs-binding --enable-dotnet-binding --enable-java-binding %* if errorlevel 1 goto :reset-java cd %build-root% diff --git a/modules/azure_functions/CMakeLists.txt b/modules/azure_functions/CMakeLists.txt index 001cb688..8ad1abfe 100644 --- a/modules/azure_functions/CMakeLists.txt +++ b/modules/azure_functions/CMakeLists.txt @@ -32,6 +32,6 @@ if(install_executables) install(TARGETS azure_functions LIBRARY DESTINATION lib) endif() -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() \ No newline at end of file diff --git a/modules/ble/CMakeLists.txt b/modules/ble/CMakeLists.txt index 9e284e53..f6d40135 100644 --- a/modules/ble/CMakeLists.txt +++ b/modules/ble/CMakeLists.txt @@ -115,7 +115,7 @@ linkSharedUtil(ble_c2d_static) add_module_to_solution(ble) add_module_to_solution(ble_c2d) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/modules/ble/tests/ble_ut/CMakeLists.txt b/modules/ble/tests/ble_ut/CMakeLists.txt index bef2798e..4d682233 100644 --- a/modules/ble/tests/ble_ut/CMakeLists.txt +++ b/modules/ble/tests/ble_ut/CMakeLists.txt @@ -79,5 +79,7 @@ if(WIN32) rpcrt4 ) install_broker(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + copy_gateway_dll(${theseTestsName}_exe ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + endif() endif() diff --git a/modules/dependencies.cmake b/modules/dependencies.cmake index c71749dd..9d1cdac4 100644 --- a/modules/dependencies.cmake +++ b/modules/dependencies.cmake @@ -6,34 +6,34 @@ include("../gatewayFunctions.cmake") ############################################################################### ###########################Find/Install/Build uamqp############################ ############################################################################### -findAndInstall(uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp -Duse_installed_dependencies=ON -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp ${PROJECT_SOURCE_DIR}/deps/uamqp -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") ############################################################################### ###########################Find/Install/Build umqtt############################ ############################################################################### -findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt -Duse_installed_dependencies=ON -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt -Duse_installed_dependencies=ON -G "${CMAKE_GENERATOR}") ############################################################################### #######################Find/Install/Build azure_iot_sdks####################### ############################################################################### #The azure_iot_sdks repo requires special treatment. Parson submodule must be initialized. -if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c/parson/README.md) +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c/parson/README.md) execute_process( - COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/iot-sdk + COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE res ) if(${res}) - message(FATAL_ERROR "Error pulling iot-sdk submodule: ${res}") + message(FATAL_ERROR "Error pulling iot-sdk-c submodule: ${res}") endif() execute_process( - COMMAND git submodule update --init c/parson - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk + COMMAND git submodule update --init parson + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c RESULT_VARIABLE res ) if(${res}) message(FATAL_ERROR "Error pulling parson submodule: ${res}") endif() endif() -findAndInstall(azure_iot_sdks ${PROJECT_SOURCE_DIR}/deps/iot-sdk ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c -Duse_installed_dependencies=ON -Duse_openssl=OFF -Dskip_unittests=ON -G "${CMAKE_GENERATOR}") +findAndInstall(azure_iot_sdks ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c ${PROJECT_SOURCE_DIR}/deps/iot-sdk-c -Duse_installed_dependencies=ON -Duse_openssl=OFF -Dbuild_as_shared=ON -Drun_e2e_tests=ON -G "${CMAKE_GENERATOR}") diff --git a/modules/identitymap/CMakeLists.txt b/modules/identitymap/CMakeLists.txt index e28034c4..772d82eb 100644 --- a/modules/identitymap/CMakeLists.txt +++ b/modules/identitymap/CMakeLists.txt @@ -32,6 +32,6 @@ if(install_modules) install(TARGETS identity_map LIBRARY DESTINATION "${LIB_INSTALL_DIR}/modules") endif() -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/modules/iothub/CMakeLists.txt b/modules/iothub/CMakeLists.txt index 6a5aadbd..692e0f19 100644 --- a/modules/iothub/CMakeLists.txt +++ b/modules/iothub/CMakeLists.txt @@ -69,7 +69,7 @@ linkSharedUtil(iothub_static) add_module_to_solution(iothub) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/modules/logger/CMakeLists.txt b/modules/logger/CMakeLists.txt index 128ecd03..7a85135d 100644 --- a/modules/logger/CMakeLists.txt +++ b/modules/logger/CMakeLists.txt @@ -36,7 +36,7 @@ linkSharedUtil(logger_static) add_module_to_solution(logger) -if(NOT ${skip_unittests}) +if(${run_unittests}) add_subdirectory(tests) endif() diff --git a/samples/azure_functions_sample/CMakeLists.txt b/samples/azure_functions_sample/CMakeLists.txt index 821c3283..c9aa33ee 100644 --- a/samples/azure_functions_sample/CMakeLists.txt +++ b/samples/azure_functions_sample/CMakeLists.txt @@ -34,5 +34,7 @@ add_dependencies(azure_functions_sample hello_world azure_functions) target_link_libraries(azure_functions_sample gateway) linkSharedUtil(azure_functions_sample) install_broker(azure_functions_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(azure_functions_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_iothub_client_dll(azure_functions_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) add_sample_to_solution(azure_functions_sample) \ No newline at end of file diff --git a/samples/ble_gateway/CMakeLists.txt b/samples/ble_gateway/CMakeLists.txt index fcd60ba6..f060fc21 100644 --- a/samples/ble_gateway/CMakeLists.txt +++ b/samples/ble_gateway/CMakeLists.txt @@ -34,6 +34,8 @@ add_dependencies(ble_gateway ble ble_printer identity_map logger iothub) linkSharedUtil(ble_gateway) install_broker(ble_gateway ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(ble_gateway ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) + add_sample_to_solution(ble_gateway) diff --git a/samples/dotnet_binding_sample/CMakeLists.txt b/samples/dotnet_binding_sample/CMakeLists.txt index abe7ad53..5b42828f 100644 --- a/samples/dotnet_binding_sample/CMakeLists.txt +++ b/samples/dotnet_binding_sample/CMakeLists.txt @@ -24,6 +24,7 @@ add_dependencies(dotnet_binding_sample dotnet logger) target_link_libraries(dotnet_binding_sample gateway) linkSharedUtil(dotnet_binding_sample) install_broker(dotnet_binding_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(dotnet_binding_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) install_binaries(dotnet_binding_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_managed_binding_dll} ) install_binaries(dotnet_binding_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_host_binding_dll} ) install_binaries(dotnet_binding_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ${dotnet_sensor_module_dll} ) diff --git a/samples/experimental/events_sample/CMakeLists.txt b/samples/experimental/events_sample/CMakeLists.txt index 3be07e5e..632897a0 100644 --- a/samples/experimental/events_sample/CMakeLists.txt +++ b/samples/experimental/events_sample/CMakeLists.txt @@ -19,6 +19,8 @@ linkSharedUtil(events_sample) add_dependencies(events_sample hello_world) install_broker(events_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(events_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_iothub_client_dll(events_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) # add events_sample to non-standard "Experimental" VS project folder for now #add_sample_to_solution(events_sample) diff --git a/samples/hello_world/CMakeLists.txt b/samples/hello_world/CMakeLists.txt index 4a492dea..42397bdc 100644 --- a/samples/hello_world/CMakeLists.txt +++ b/samples/hello_world/CMakeLists.txt @@ -31,5 +31,6 @@ add_dependencies(hello_world_sample hello_world logger) target_link_libraries(hello_world_sample gateway nanomsg) linkSharedUtil(hello_world_sample) install_broker(hello_world_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(hello_world_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) add_sample_to_solution(hello_world_sample) \ No newline at end of file diff --git a/samples/java_sample/CMakeLists.txt b/samples/java_sample/CMakeLists.txt index 6ddf6089..98457dd8 100644 --- a/samples/java_sample/CMakeLists.txt +++ b/samples/java_sample/CMakeLists.txt @@ -33,6 +33,8 @@ target_link_libraries(java_sample gateway) add_dependencies(java_sample java_module_host logger) linkSharedUtil(java_sample) install_broker(java_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(java_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_iothub_client_dll(java_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) add_sample_to_solution(java_sample) \ No newline at end of file diff --git a/samples/nodejs_simple_sample/CMakeLists.txt b/samples/nodejs_simple_sample/CMakeLists.txt index 8dccea3b..13828d29 100644 --- a/samples/nodejs_simple_sample/CMakeLists.txt +++ b/samples/nodejs_simple_sample/CMakeLists.txt @@ -36,6 +36,7 @@ add_dependencies(nodejs_simple_sample nodejs_binding logger) linkSharedUtil(nodejs_simple_sample) install_broker(nodejs_simple_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) copy_node_dll(nodejs_simple_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(nodejs_simple_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) add_sample_to_solution(nodejs_simple_sample) diff --git a/samples/simulated_device_cloud_upload/CMakeLists.txt b/samples/simulated_device_cloud_upload/CMakeLists.txt index 76604e1c..0a7304fa 100644 --- a/samples/simulated_device_cloud_upload/CMakeLists.txt +++ b/samples/simulated_device_cloud_upload/CMakeLists.txt @@ -39,6 +39,8 @@ target_link_libraries(simulated_device_cloud_upload_sample gateway) linkSharedUtil(simulated_device_cloud_upload_sample) linkHttp(simulated_device_cloud_upload_sample) install_broker(simulated_device_cloud_upload_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_gateway_dll(simulated_device_cloud_upload_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) +copy_iothub_client_dll(simulated_device_cloud_upload_sample ${CMAKE_CURRENT_BINARY_DIR}/$(Configuration) ) add_sample_to_solution(simulated_device_cloud_upload_sample) diff --git a/samples/simulated_device_cloud_upload/src/azure-iot-field-gateway-sdk.bb b/samples/simulated_device_cloud_upload/src/azure-iot-field-gateway-sdk.bb index c0b3cb15..f4555458 100644 --- a/samples/simulated_device_cloud_upload/src/azure-iot-field-gateway-sdk.bb +++ b/samples/simulated_device_cloud_upload/src/azure-iot-field-gateway-sdk.bb @@ -2,13 +2,13 @@ DESCRIPTION = "" LICENSE = "MI" SRC_URI = "file:///home/<>/azure-iot-gateway-sdk" -LIC_FILES_CHKSUM = "file:///home/<>/azure-iot-gateway-sdk/deps/iot-sdk/LICENSE;md5=4283671594edec4c13aeb073c219237a" +LIC_FILES_CHKSUM = "file:///home/<>/azure-iot-gateway-sdk/deps/iot-sdk-c/LICENSE;md5=4283671594edec4c13aeb073c219237a" PROVIDES = "azure-iot-gateway-sdk" DEPENDS = "glib-2.0 curl" -EXTRA_OECMAKE = "-Dinstall_executables:BOOL=ON -Drun_as_a_service:BOOL=ON -Dskip_unittests:BOOL=ON" +EXTRA_OECMAKE = "-Dinstall_executables:BOOL=ON -Drun_as_a_service:BOOL=ON -Drun_unittests:BOOL=OFF" S = "${WORKDIR}/home/azure-iot-gateway-sdk" diff --git a/tools/Dockerfile b/tools/Dockerfile index 393758a2..306b9633 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -38,5 +38,5 @@ ENTRYPOINT rm -rf /gateway && \ git clone ${GATEWAY_REPO} /gateway && \ git -C /gateway checkout ${COMMIT_ID} && \ git -C /gateway submodule update --init && \ - /gateway/tools/build.sh -rv --enable-java-binding --enable-nodejs-binding && \ + /gateway/tools/build.sh --run-unittests -rv --enable-java-binding --enable-nodejs-binding && \ bash diff --git a/tools/build.cmd b/tools/build.cmd index 1bed4d0c..ed755975 100644 --- a/tools/build.cmd +++ b/tools/build.cmd @@ -22,7 +22,7 @@ rem ---------------------------------------------------------------------------- rem // default build options set build-config=Debug set build-platform=Win32 -set CMAKE_skip_unittests=OFF +set CMAKE_run_unittests=OFF set CMAKE_run_e2e_tests=OFF set CMAKE_enable_dotnet_binding=OFF set enable-java-binding=OFF @@ -34,7 +34,7 @@ set dependency_install_prefix="-Ddependency_install_prefix=%local-install%" if "%1" equ "" goto args-done if "%1" equ "--config" goto arg-build-config if "%1" equ "--platform" goto arg-build-platform -if "%1" equ "--skip-unittests" goto arg-skip-unittests +if "%1" equ "--run-unittests" goto arg-run-unittests if "%1" equ "--run-e2e-tests" goto arg-run-e2e-tests if "%1" equ "--enable-dotnet-binding" goto arg-enable-dotnet-binding if "%1" equ "--enable-java-binding" goto arg-enable-java-binding @@ -56,8 +56,8 @@ if "%1" equ "" call :usage && exit /b 1 set build-platform=%1 goto args-continue -:arg-skip-unittests -set CMAKE_skip_unittests=ON +:arg-run-unittests +set CMAKE_run_unittests=ON goto args-continue :arg-run-e2e-tests @@ -112,18 +112,18 @@ if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! pushd %cmake-root% if %build-platform% == x64 ( echo ***Running CMAKE for Win64*** - cmake %dependency_install_prefix% -Dskip_unittests:BOOL=%CMAKE_skip_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% "%build-root%" -G "Visual Studio 14 Win64" + cmake %dependency_install_prefix% -Drun_unittests:BOOL=%CMAKE_run_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% "%build-root%" -G "Visual Studio 14 Win64" if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! ) else ( echo ***Running CMAKE for Win32*** - cmake %dependency_install_prefix% -Dskip_unittests:BOOL=%CMAKE_skip_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% "%build-root%" + cmake %dependency_install_prefix% -Drun_unittests:BOOL=%CMAKE_run_unittests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Denable_dotnet_binding:BOOL=%CMAKE_enable_dotnet_binding% -Denable_java_binding:BOOL=%enable-java-binding% -Denable_nodejs_binding:BOOL=%enable_nodejs_binding% -Denable_ble_module:BOOL=%CMAKE_enable_ble_module% "%build-root%" if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! ) msbuild /m /p:Configuration="%build-config%" /p:Platform="%build-platform%" azure_iot_gateway_sdk.sln if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! -if "%CMAKE_skip_unittests%"=="ON" if "%CMAKE_run_e2e_tests%"=="OFF" goto skip-tests +if "%CMAKE_run_unittests%"=="OFF" if "%CMAKE_run_e2e_tests%"=="OFF" goto skip-tests ctest -C "debug" -V if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL! @@ -141,7 +141,7 @@ echo build.cmd [options] echo options: echo --config value Build configuration (e.g. [Debug], Release) echo --platform value Build platform (e.g. [Win32], x64, ...) -echo --skip-unittests Do not build/run unit tests +echo --run-unittests Build/run unit tests echo --run-e2e-tests Build/run end-to-end tests echo --enable-dotnet-binding Build the .NET binding echo --enable-java-binding Build the Java binding diff --git a/tools/build.sh b/tools/build.sh index 9adcdc84..6ae0306e 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -8,7 +8,7 @@ build_clean= build_root=$(cd "$(dirname "$0")/.." && pwd) local_install=$build_root/install-deps log_dir=$build_root -skip_unittests=OFF +run_unittests=OFF run_e2e_tests=OFF run_valgrind=0 enable_java_binding=OFF @@ -28,7 +28,7 @@ usage () echo " Example: -cl -O1 -cl ..." echo " -rv, --run-valgrind Execute ctest with valgrind" echo " --toolchain-file Pass CMake a toolchain file for cross-compiling" - echo " --skip-unittests Do not build/run unit tests" + echo " --run-unittests Build/run unit tests" echo " --run-e2e-tests Build/run end-to-end tests" echo " --enable-java-binding Build the Java binding" echo " (JAVA_HOME must be defined in your environment)" @@ -63,7 +63,7 @@ process_args () case "$arg" in "-x" | "--xtrace" ) set -x;; "-c" | "--clean" ) build_clean=1;; - "--skip-unittests" ) skip_unittests=ON;; + "--run-unittests" ) run_unittests=ON;; "--run-e2e-tests" ) run_e2e_tests=ON;; "-cl" | "--compileoption" ) save_next_arg=1;; "-rv" | "--run-valgrind" ) run_valgrind=1;; @@ -124,7 +124,7 @@ cmake $toolchainfile \ $dependency_install_prefix \ -DcompileOption_C:STRING="$extracloptions" \ -DCMAKE_BUILD_TYPE=Debug \ - -Dskip_unittests:BOOL=$skip_unittests \ + -Drun_unittests:BOOL=$run_unittests \ -Drun_e2e_tests:BOOL=$run_e2e_tests \ -Denable_java_binding:BOOL=$enable_java_binding \ -Denable_nodejs_binding:BOOL=$enable_nodejs_binding \ @@ -135,7 +135,7 @@ cmake $toolchainfile \ make --jobs=$CORES -if [[ "$skip_unittests" == "OFF" || "$run_e2e_tests" == "ON" ]] +if [[ "$run_unittests" == "ON" || "$run_e2e_tests" == "ON" ]] then if [[ $run_valgrind == 1 ]] then diff --git a/tools/inteledison_c.sh b/tools/inteledison_c.sh index a0931273..41a116c4 100755 --- a/tools/inteledison_c.sh +++ b/tools/inteledison_c.sh @@ -110,7 +110,7 @@ cmake_root="$build_root"/build rm -r -f "$cmake_root" mkdir -p "$cmake_root" pushd "$cmake_root" -cmake $dependency_install_prefix -DCMAKE_TOOLCHAIN_FILE=$FILE -DCMAKE_BUILD_TYPE=Debug -Drun_e2e_tests:BOOL=OFF -Dskip_unittests:BOOL=ON -Drun_valgrind:BOOL=OFF "$build_root" +cmake $dependency_install_prefix -DCMAKE_TOOLCHAIN_FILE=$FILE -DCMAKE_BUILD_TYPE=Debug -Drun_e2e_tests:BOOL=OFF -Drun_unittests:BOOL=OFF -Drun_valgrind:BOOL=OFF "$build_root" [ $? -eq 0 ] || exit $? make --jobs=$(nproc) diff --git a/tools/windriver_linux_c.sh b/tools/windriver_linux_c.sh index 7c2c70af..38efbd5d 100755 --- a/tools/windriver_linux_c.sh +++ b/tools/windriver_linux_c.sh @@ -107,7 +107,7 @@ cmake_root="$build_root"/build rm -r -f "$cmake_root" mkdir -p "$cmake_root" pushd "$cmake_root" -cmake -Ddependency_install_prefix=$local_install -DCMAKE_BUILD_TYPE=Debug -Dskip_unittests:BOOL=ON -Drun_e2e_tests:BOOL=OFF -Drun_valgrind:BOOL=OFF "$build_root" +cmake -Ddependency_install_prefix=$local_install -DCMAKE_BUILD_TYPE=Debug -Drun_unittests:BOOL=OFF -Drun_e2e_tests:BOOL=OFF -Drun_valgrind:BOOL=OFF "$build_root" [ $? -eq 0 ] || exit $? make --jobs=$(nproc)