diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c32dff..68e0f5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,10 +8,10 @@ cmake_minimum_required(VERSION 3.2) project(ade) -option(ENABLE_TESTING "Build tests, require google test" OFF) -option(BUILD_TUTORIAL "Build tutorial samples" OFF) -option(FORCE_ADE_ASSERTS "Always enable ADE_ASSERT" OFF) -option(BUILD_DOCUMENTATION "Build doxygen documentation" OFF) +option(ENABLE_ADE_TESTING "Build tests, require google test" OFF) +option(BUILD_ADE_TUTORIAL "Build tutorial samples" OFF) +option(FORCE_ADE_ASSERTS "Always enable ADE_ASSERT" OFF) +option(BUILD_ADE_DOCUMENTATION "Build doxygen documentation" OFF) # TODO: this is horrible hack, we must follow cmake # build/install policy @@ -48,12 +48,12 @@ endif(MSVC) add_subdirectory(sources/ade/) -if(ENABLE_TESTING) +if(ENABLE_ADE_TESTING) enable_testing() add_subdirectory(sources/tests) endif() -if(BUILD_TUTORIAL) +if(BUILD_ADE_TUTORIAL) add_subdirectory(tutorial) endif() diff --git a/README.md b/README.md index 41874a4..f6b17b0 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,18 @@ After a successfull compilation binaries should reside in `./lib` and to run ADE Framework test suite (ADE Framework tests + utility tests). -If you want to build tutorial samples set `-DBUILD_TUTORIAL=ON` to +If you want to build tutorial samples set `-DBUILD_ADE_TUTORIAL=ON` to cmake. Building with tutorial: - $ cmake -DBUILD_TUTORIAL=ON /path/to/ade/repository + $ cmake -DBUILD_ADE_TUTORIAL=ON /path/to/ade/repository $ make -j Additional information on tutorial samples can be found in `./tutorial/README.md`. -If you want to build library tests set `-DENABLE_TESTING=ON` to cmake. +If you want to build library tests set `-DENABLE_ADE_TESTING=ON` to cmake. Tests require gtest (https://github.com/google/googletest/releases). Building gtest: @@ -46,7 +46,7 @@ Building gtest: Building with tests: - $ cmake -DENABLE_TESTING=ON -DGTEST_ROOT=/gtest/install/path /path/to/ade/repository + $ cmake -DENABLE_ADE_TESTING=ON -DGTEST_ROOT=/gtest/install/path /path/to/ade/repository $ make -j You can build library with hardened asserts via @@ -59,7 +59,7 @@ input directly and doesn't read any files or sockets. If you want to use this library to process any input from external source you must validate it before doing any library calls. -To build documentation set `-DBUILD_DOCUMENTATION=ON`. Documentation +To build documentation set `-DBUILD_ADE_DOCUMENTATION=ON`. Documentation can be found in `./doc` directory. Doxygen is required. ## Support diff --git a/sources/ade/CMakeLists.txt b/sources/ade/CMakeLists.txt index 14d1593..2d1dd20 100644 --- a/sources/ade/CMakeLists.txt +++ b/sources/ade/CMakeLists.txt @@ -24,7 +24,7 @@ if(FORCE_ADE_ASSERTS) target_compile_definitions( ${PROJECT_NAME} PUBLIC FORCE_ADE_ASSERTS ) endif() -if(BUILD_DOCUMENTATION) +if(BUILD_ADE_DOCUMENTATION) find_package(Doxygen REQUIRED) set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) diff --git a/sources/ade/include/ade/communication/callback_connector.hpp b/sources/ade/include/ade/communication/callback_connector.hpp index 1929aab..6225d8e 100644 --- a/sources/ade/include/ade/communication/callback_connector.hpp +++ b/sources/ade/include/ade/communication/callback_connector.hpp @@ -199,7 +199,7 @@ std::function CallbackConnector::finalize() } } ADE_ASSERT(nullptr != m_producerCallback); - return std::move(resetter); + return resetter; } template diff --git a/sources/ade/source/alloc.cpp b/sources/ade/source/alloc.cpp index 47dc045..af46227 100644 --- a/sources/ade/source/alloc.cpp +++ b/sources/ade/source/alloc.cpp @@ -6,7 +6,7 @@ #include "ade/memory/alloc.hpp" -#ifdef WIN32 +#if defined(WIN32) || defined(__ANDROID__) || defined(ANDROID) #include #else #include @@ -22,8 +22,10 @@ namespace ade void* aligned_alloc(std::size_t size, std::size_t alignment) { ADE_ASSERT(util::is_pow2(alignment)); -#ifdef WIN32 +#if defined(WIN32) return _aligned_malloc(size, alignment); +#elif defined(__ANDROID__) || defined(ANDROID) + return memalign(alignment, size); #else void* ret = nullptr; auto res = posix_memalign(&ret, std::max(sizeof(void*), alignment), size); @@ -34,7 +36,7 @@ void* aligned_alloc(std::size_t size, std::size_t alignment) void aligned_free(void* ptr) { -#ifdef WIN32 +#if defined(WIN32) return _aligned_free(ptr); #else return free(ptr); diff --git a/sources/ade/source/subgraphs.cpp b/sources/ade/source/subgraphs.cpp index 2672988..d2d3cfb 100644 --- a/sources/ade/source/subgraphs.cpp +++ b/sources/ade/source/subgraphs.cpp @@ -179,6 +179,7 @@ void findPaths(const NodeHandle& src, const NodeHandle& dst, const std::vector& path, const NodeHandle& prev, const NodeHandle& next) { + ADE_UNUSED(prev); ADE_ASSERT(nullptr != prev); ADE_ASSERT(nullptr != next); if (next == dst)