From ce82aad981873b243b133e33abadaf628cd2c243 Mon Sep 17 00:00:00 2001 From: "Pawel.Paprocki" Date: Mon, 17 May 2021 14:21:27 +0200 Subject: [PATCH] [BH-358] Add Move TPLIB (CRC32) to separate directory Change directory location and update CMAKE --- .gitmodules | 2 +- CMakeLists.txt | 2 ++ module-services/service-desktop/CMakeLists.txt | 1 + .../service-desktop/endpoints/CMakeLists.txt | 0 .../endpoints/update/UpdateMuditaOS.cpp | 2 +- module-utils/CMakeLists.txt | 3 ++- module-utils/Utils.cpp | 4 ++-- module-utils/bootconfig/CMakeLists.txt | 8 +++++++- module-utils/bootconfig/src/bootconfig.cpp | 4 ++-- third-party/CMakeLists.txt | 2 ++ third-party/crc32/CMakeLists.txt | 13 +++++++++++++ module-utils/crc32 => third-party/crc32/src | 0 12 files changed, 33 insertions(+), 8 deletions(-) delete mode 100755 module-services/service-desktop/endpoints/CMakeLists.txt create mode 100644 third-party/CMakeLists.txt create mode 100644 third-party/crc32/CMakeLists.txt rename module-utils/crc32 => third-party/crc32/src (100%) diff --git a/.gitmodules b/.gitmodules index 94b588f4f072c2299488169408dad232ef9f5e60..30017ca5677c3c6d19926749ddd487f32fb2b882 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ path = module-utils/segger url = ../segger-utils.git [submodule "module-utils/crc32"] - path = module-utils/crc32 + path = third-party/crc32/src url = ../crc32 [submodule "module-utils/re2"] path = module-utils/re2 diff --git a/CMakeLists.txt b/CMakeLists.txt index b53265abccbc12bb032b0895ead08c2c8d6de721..9107636260b0cf58246b64361c44f6b29c759ae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,6 +192,8 @@ add_subdirectory(module-bluetooth) message("${PROJECT_NAME}: add_subdirectory module-lwip") add_subdirectory(module-lwip) +add_subdirectory(third-party) + add_subdirectory(image) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES SUFFIX ".elf") diff --git a/module-services/service-desktop/CMakeLists.txt b/module-services/service-desktop/CMakeLists.txt index ef7b4de62251c76403eb97d5750af5085ff9f27d..53c77dfd74dd70eba1c0f3e4b684ca3362497807 100644 --- a/module-services/service-desktop/CMakeLists.txt +++ b/module-services/service-desktop/CMakeLists.txt @@ -58,6 +58,7 @@ target_link_libraries(${PROJECT_NAME} service-evtmgr module-utils module-cellular + crc32 ) if (${ENABLE_TESTS}) diff --git a/module-services/service-desktop/endpoints/CMakeLists.txt b/module-services/service-desktop/endpoints/CMakeLists.txt deleted file mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp b/module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp index a3162b05f579453bcd154b3f92603a3a06336aae..57d8a4583f2361b9d6b4f98f0848e0946781e354 100644 --- a/module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp +++ b/module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/module-utils/CMakeLists.txt b/module-utils/CMakeLists.txt index fcdb45769a65d6fc3c1dfcabb35c450b307e6bee..9fb9902b3d9c22b014f169ab76bf34285b584030 100644 --- a/module-utils/CMakeLists.txt +++ b/module-utils/CMakeLists.txt @@ -29,7 +29,6 @@ set (SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ucs2/UCS2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/time/time_date_validation.cpp ${CMAKE_CURRENT_SOURCE_DIR}/microtar/src/microtar.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/crc32/crc32.c ${CMAKE_CURRENT_SOURCE_DIR}/PhoneNumber.cpp ${CMAKE_CURRENT_SOURCE_DIR}/PhoneNumber.hpp ${CMAKE_CURRENT_SOURCE_DIR}/NumberHolderMatcher.hpp @@ -68,6 +67,8 @@ set( TAGLIB_INCLUDE_DIRS PARENT_SCOPE ) +target_link_libraries(${PROJECT_NAME} PRIVATE crc32 ) + # link against tinyexpr target_link_libraries (${PROJECT_NAME} PUBLIC ${TINYEXPR_TARGET}) diff --git a/module-utils/Utils.cpp b/module-utils/Utils.cpp index 1dcd27b6d1fb937a612b0e854b4d4d5eef8efd3f..c972de62816830f00dadd84a7fafcfc7faac284d 100644 --- a/module-utils/Utils.cpp +++ b/module-utils/Utils.cpp @@ -1,9 +1,9 @@ -// 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 #include "Utils.hpp" #include -#include +#include namespace utils::filesystem { diff --git a/module-utils/bootconfig/CMakeLists.txt b/module-utils/bootconfig/CMakeLists.txt index 2feb835aa75b8596a4898ab937674c6f676c5139..11b270d8733a290433cf6c75e8f51713d8f413d4 100644 --- a/module-utils/bootconfig/CMakeLists.txt +++ b/module-utils/bootconfig/CMakeLists.txt @@ -15,4 +15,10 @@ set( INCLUDES add_library( ${PROJECT_NAME} STATIC ${SOURCES} ) target_include_directories( ${PROJECT_NAME} PUBLIC ${INCLUDES} ) -target_link_libraries( ${PROJECT_NAME} PRIVATE module-utils module-vfs) + +target_link_libraries( ${PROJECT_NAME} + PRIVATE + module-utils + module-vfs + crc32 +) diff --git a/module-utils/bootconfig/src/bootconfig.cpp b/module-utils/bootconfig/src/bootconfig.cpp index bf83a3567c664e5f3606877e7c79a8168928764e..de23f7ace6c6e5263d55e2bf0b7a748114a320eb 100644 --- a/module-utils/bootconfig/src/bootconfig.cpp +++ b/module-utils/bootconfig/src/bootconfig.cpp @@ -1,4 +1,4 @@ -// 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 #include #include @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b823f70e3f5993ce5398f8ef42ee6b580c99afe --- /dev/null +++ b/third-party/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_subdirectory(crc32) diff --git a/third-party/crc32/CMakeLists.txt b/third-party/crc32/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1eb7432e4fcb82acf8b2f4593c7f7e2ba753333c --- /dev/null +++ b/third-party/crc32/CMakeLists.txt @@ -0,0 +1,13 @@ + +add_library(crc32) +target_sources(crc32 + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src/crc32.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/crc32.h +) + +target_include_directories(crc32 + PUBLIC + $ +) + diff --git a/module-utils/crc32 b/third-party/crc32/src similarity index 100% rename from module-utils/crc32 rename to third-party/crc32/src