From 255cdd5454730fd98ba61c40395c277f483b92c8 Mon Sep 17 00:00:00 2001 From: Nikita Poltorapavlo Date: Thu, 13 Jun 2024 15:56:42 +0300 Subject: [PATCH] adapt to the recent changes in Thunder master branch --- PersistentStore/CMakeLists.txt | 6 ++++++ PersistentStore/PersistentStore.cpp | 4 ++++ PersistentStore/grpc/l0test/CMakeLists.txt | 6 ++++++ PersistentStore/l0test/CMakeLists.txt | 6 ++++++ PersistentStore/l1test/CMakeLists.txt | 6 ++++++ PersistentStore/sqlite/l1test/CMakeLists.txt | 8 +++++++- 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/PersistentStore/CMakeLists.txt b/PersistentStore/CMakeLists.txt index dc5c44a975..429bec4f2a 100644 --- a/PersistentStore/CMakeLists.txt +++ b/PersistentStore/CMakeLists.txt @@ -19,6 +19,12 @@ cmake_minimum_required(VERSION 3.14) set(PLUGIN_NAME PersistentStore) find_package(WPEFramework) +if (NOT WPEFramework_FOUND) + find_package(Thunder) + if (Thunder_FOUND) + add_compile_definitions(WITH_THUNDER_NAMESPACE) + endif () +endif () set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME}) set(CMAKE_CXX_STANDARD 11) diff --git a/PersistentStore/PersistentStore.cpp b/PersistentStore/PersistentStore.cpp index 5f030bde9b..443c92e46d 100644 --- a/PersistentStore/PersistentStore.cpp +++ b/PersistentStore/PersistentStore.cpp @@ -31,7 +31,11 @@ namespace WPEFramework { namespace { +#ifdef WITH_THUNDER_NAMESPACE + static Thunder::Plugin::Metadata metadata( +#else static Plugin::Metadata metadata( +#endif // Version (Major, Minor, Patch) API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH, // Preconditions diff --git a/PersistentStore/grpc/l0test/CMakeLists.txt b/PersistentStore/grpc/l0test/CMakeLists.txt index 8e4aa0ab13..520fb656df 100644 --- a/PersistentStore/grpc/l0test/CMakeLists.txt +++ b/PersistentStore/grpc/l0test/CMakeLists.txt @@ -35,6 +35,12 @@ FetchContent_MakeAvailable(googletest) target_link_libraries(${PROJECT_NAME} PRIVATE gmock_main) find_package(WPEFramework) +if (NOT WPEFramework_FOUND) + find_package(Thunder) + if (Thunder_FOUND) + add_compile_definitions(WITH_THUNDER_NAMESPACE) + endif () +endif () find_package(${NAMESPACE}Plugins REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins) diff --git a/PersistentStore/l0test/CMakeLists.txt b/PersistentStore/l0test/CMakeLists.txt index d8f1e6ee20..8a7675f16d 100644 --- a/PersistentStore/l0test/CMakeLists.txt +++ b/PersistentStore/l0test/CMakeLists.txt @@ -29,6 +29,12 @@ FetchContent_Declare( FetchContent_MakeAvailable(googletest) find_package(WPEFramework) +if (NOT WPEFramework_FOUND) + find_package(Thunder) + if (Thunder_FOUND) + add_compile_definitions(WITH_THUNDER_NAMESPACE) + endif () +endif () find_package(${NAMESPACE}Plugins REQUIRED) find_package(${NAMESPACE}Definitions REQUIRED) diff --git a/PersistentStore/l1test/CMakeLists.txt b/PersistentStore/l1test/CMakeLists.txt index 67d7b50ff5..13edcf8f87 100644 --- a/PersistentStore/l1test/CMakeLists.txt +++ b/PersistentStore/l1test/CMakeLists.txt @@ -29,6 +29,12 @@ FetchContent_Declare( FetchContent_MakeAvailable(googletest) find_package(WPEFramework) +if (NOT WPEFramework_FOUND) + find_package(Thunder) + if (Thunder_FOUND) + add_compile_definitions(WITH_THUNDER_NAMESPACE) + endif () +endif () find_package(${NAMESPACE}Plugins REQUIRED) find_package(${NAMESPACE}Definitions REQUIRED) diff --git a/PersistentStore/sqlite/l1test/CMakeLists.txt b/PersistentStore/sqlite/l1test/CMakeLists.txt index 698833ebf3..b69de898b7 100644 --- a/PersistentStore/sqlite/l1test/CMakeLists.txt +++ b/PersistentStore/sqlite/l1test/CMakeLists.txt @@ -28,7 +28,13 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(googletest) -find_package(WPEFramework REQUIRED) +find_package(WPEFramework) +if (NOT WPEFramework_FOUND) + find_package(Thunder) + if (Thunder_FOUND) + add_compile_definitions(WITH_THUNDER_NAMESPACE) + endif () +endif () find_package(${NAMESPACE}Plugins REQUIRED) add_executable(${PROJECT_NAME}