From 6fe90d4bef3aa0b17feed6a9969d813ff85a7688 Mon Sep 17 00:00:00 2001 From: DariuszSabala Date: Thu, 27 May 2021 09:21:20 +0200 Subject: [PATCH] [BH-461] Move TPLIB minimp3 to separate dir Moved minimp3 to third-party directory, added our CMakeLists.txt with interface library defined and upgraded include paths --- .gitmodules | 8 ++++---- cmake/modules/PureCoverage.cmake | 5 +---- module-audio/Audio/decoder/decoderMP3.hpp | 7 +++---- module-audio/CMakeLists.txt | 14 ++++++++------ third-party/CMakeLists.txt | 1 + third-party/minimp3/CMakeLists.txt | 7 +++++++ .../Audio/decoder => third-party/minimp3}/minimp3 | 0 7 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 third-party/minimp3/CMakeLists.txt rename {module-audio/Audio/decoder => third-party/minimp3}/minimp3 (100%) diff --git a/.gitmodules b/.gitmodules index 54e221fe1ef5bb7bf48026bbe91cb801db318ee5..8481ce7f44759c230a7e5c6db0148628906f4e4e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,10 +36,6 @@ [submodule "module-utils/date"] path = third-party/date url = ../date.git -[submodule "module-audio/Audio/decoder/minimp3"] - path = module-audio/Audio/decoder/minimp3 - url = ../minimp3.git - branch = RT1051 [submodule "module-utils/taglib"] path = module-utils/taglib url = ../taglib.git @@ -84,3 +80,7 @@ [submodule "module-utils/CrashDebug"] path = module-utils/CrashDebug url = https://github.com/adamgreen/CrashDebug.git +[submodule "third-party/minimp3/minimp3"] + path = third-party/minimp3/minimp3 + url = ../minimp3.git + branch = RT1051 diff --git a/cmake/modules/PureCoverage.cmake b/cmake/modules/PureCoverage.cmake index a3e9f50c6a6e2080fe029602e906d15cccb813b7..d8baef31afcb1fac957a6f7dfc1577b79c3ca2e0 100644 --- a/cmake/modules/PureCoverage.cmake +++ b/cmake/modules/PureCoverage.cmake @@ -22,7 +22,6 @@ if(COVERAGE_ENABLE) board/linux/libiosyscalls/.* host-tools/.* module-audio/Audio/decoder/dr_flac.h - module-audio/Audio/decoder/minimp3/minimp3.h module-bluetooth/Bluetooth/glucode/.* module-bluetooth/lib/.* module-db/Database/sqlite3.c @@ -31,17 +30,15 @@ if(COVERAGE_ENABLE) module-utils/gsl/.* module-utils/json/.* module-utils/libphonenumber/.* - module-utils/microtar/.* module-utils/parallel-hashmap/.* module-utils/protobuf/.* - third-party/pugixml/.* module-utils/re2/.* module-utils/segger/.* - module-utils/sml/.* module-utils/taglib/.* module-utils/tinyexpr/.* source/main.cpp test/.* + third-party/.* ) SET(GCOVR_ADDITIONAL_ARGS diff --git a/module-audio/Audio/decoder/decoderMP3.hpp b/module-audio/Audio/decoder/decoderMP3.hpp index 425311a1a73c9c6c762581ff907335071fea7dc9..25f31c75a29f23a1c01e35465b28618b95e6ce20 100644 --- a/module-audio/Audio/decoder/decoderMP3.hpp +++ b/module-audio/Audio/decoder/decoderMP3.hpp @@ -1,12 +1,11 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #pragma once -#include "minimp3/minimp3.h" - -#include #include "Decoder.hpp" +#include +#include extern "C" { diff --git a/module-audio/CMakeLists.txt b/module-audio/CMakeLists.txt index fd44c78e0e7861ac5bf84fea1fb93eb9eab64be6..66a86a2640634d1ffc9a8c381c861f70d1792ae4 100755 --- a/module-audio/CMakeLists.txt +++ b/module-audio/CMakeLists.txt @@ -66,12 +66,14 @@ set_source_files_properties( ) target_link_libraries(${PROJECT_NAME} - ${AUDIO_BOARD_LIBRARY} - module-bsp - module-os - module-utils - module-sys - tag + PUBLIC + ${AUDIO_BOARD_LIBRARY} + module-bsp + module-os + module-utils + module-sys + tag + minimp3::minimp3 ) if (${ENABLE_TESTS}) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index ee0f81b62c957da47f6174558528387a77bc1c67..9ea7536f9ed75be9becb5f149dd2fa9c9c9f3e4b 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -5,3 +5,4 @@ add_subdirectory(microtar) add_subdirectory(date) add_subdirectory(pugixml) add_subdirectory(sml) +add_subdirectory(minimp3) diff --git a/third-party/minimp3/CMakeLists.txt b/third-party/minimp3/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6e003894bb480c24f0ef0912f095f7ff2061eb07 --- /dev/null +++ b/third-party/minimp3/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(minimp3 INTERFACE) +add_library(minimp3::minimp3 ALIAS minimp3) + +target_include_directories(minimp3 + INTERFACE + $ +) diff --git a/module-audio/Audio/decoder/minimp3 b/third-party/minimp3/minimp3 similarity index 100% rename from module-audio/Audio/decoder/minimp3 rename to third-party/minimp3/minimp3