From ea218693ecb4a22ab36599350838a95595485d49 Mon Sep 17 00:00:00 2001 From: nxtumUbun Date: Mon, 27 Oct 2025 02:06:39 -0700 Subject: [PATCH 1/2] fix later --- Source/CMakeLists.txt | 6 + Source/Thunder/Controller.cpp | 2 +- Source/Thunder/Controller.h | 2 +- Source/interfaces/CMakeLists.txt | 117 ++++++++++++++++++ Source/{plugins => interfaces}/IController.h | 4 +- Source/{plugins => interfaces}/IDispatcher.h | 2 +- Source/{plugins => interfaces}/IPlugin.h | 0 Source/{plugins => interfaces}/IShell.h | 0 .../{plugins => interfaces}/IStateControl.h | 0 .../IStateController.h | 0 Source/{plugins => interfaces}/ISubSystem.h | 0 .../{plugins => interfaces}/IVirtualInput.h | 0 Source/interfaces/Module.cpp | 22 ++++ Source/interfaces/Module.h | 33 +++++ Source/plugins/CMakeLists.txt | 83 +------------ Source/plugins/Configuration.h | 8 +- Source/plugins/Metadata.cpp | 4 +- Source/plugins/Metadata.h | 4 +- Source/plugins/Module.cpp | 2 +- Source/plugins/Service.h | 4 +- Source/plugins/Shell.cpp | 2 +- Source/plugins/StateControl.cpp | 2 +- Source/plugins/StateControl.h | 2 +- Source/plugins/SubSystem.cpp | 2 +- Source/plugins/SubSystem.h | 2 +- Source/plugins/Types.h | 4 +- Source/plugins/VirtualInput.h | 2 +- Source/plugins/definitions.h | 4 +- Source/plugins/plugins.h | 7 -- 29 files changed, 209 insertions(+), 111 deletions(-) create mode 100644 Source/interfaces/CMakeLists.txt rename Source/{plugins => interfaces}/IController.h (99%) rename Source/{plugins => interfaces}/IDispatcher.h (98%) rename Source/{plugins => interfaces}/IPlugin.h (100%) rename Source/{plugins => interfaces}/IShell.h (100%) rename Source/{plugins => interfaces}/IStateControl.h (100%) rename Source/{plugins => interfaces}/IStateController.h (100%) rename Source/{plugins => interfaces}/ISubSystem.h (100%) rename Source/{plugins => interfaces}/IVirtualInput.h (100%) create mode 100644 Source/interfaces/Module.cpp create mode 100644 Source/interfaces/Module.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 1ce83c3921..155cab4308 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -30,6 +30,8 @@ option(COM "Include the COM library." ON) option(PROCESS "Include the COM hosting process executable." ON) +option(INTERFACES + "Include the interfaces library." ON) option(PLUGINS "Include plugins library." ON) option(EXECUTABLE @@ -114,6 +116,10 @@ if(COM) add_subdirectory(com) endif() +if(INTERFACES) + add_subdirectory(interfaces) +endif() + if(PLUGINS) add_subdirectory(plugins) endif() diff --git a/Source/Thunder/Controller.cpp b/Source/Thunder/Controller.cpp index 0f545a7c66..0f95ce9671 100644 --- a/Source/Thunder/Controller.cpp +++ b/Source/Thunder/Controller.cpp @@ -20,7 +20,7 @@ #include "Controller.h" #include "SystemInfo.h" -#include +#include namespace Thunder { diff --git a/Source/Thunder/Controller.h b/Source/Thunder/Controller.h index a2ea797e3c..cef5424352 100644 --- a/Source/Thunder/Controller.h +++ b/Source/Thunder/Controller.h @@ -26,7 +26,7 @@ #include "IController.h" #include "PostMortem.h" -#include +#include namespace Thunder { namespace Plugin { diff --git a/Source/interfaces/CMakeLists.txt b/Source/interfaces/CMakeLists.txt new file mode 100644 index 0000000000..8b3fd9feb9 --- /dev/null +++ b/Source/interfaces/CMakeLists.txt @@ -0,0 +1,117 @@ +# If not stated otherwise in this file or this component's license file the +# following copyright and licenses apply: +# +# Copyright 2020 Metrological +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(TARGET ${NAMESPACE}Interfaces) +set(TARGET_PROXYSTUBS ${NAMESPACE}ProxyStubs) +string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) + +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") +ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") + +JsonGenerator(CODE NAMESPACE Thunder::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) +JsonGenerator(CODE NAMESPACE Thunder::PluginHost INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IStateController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) + +file(GLOB JSON_DATA_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/json/JsonData_*.h" "${CMAKE_CURRENT_BINARY_DIR}/json/json_*.h") +file(GLOB PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/ProxyStubs*.cpp") +list(APPEND JSON_CODE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/json/JStateController.h") + +add_library(${TARGET_PROXYSTUBS} SHARED + ${PROXY_STUB_SOURCES} + Module.cpp + ) + +add_library(${TARGET} INTERFACE) +target_include_directories(${TARGET} INTERFACE + $ + $ + ) + +set(PUBLIC_HEADERS + IController.h + IDispatcher.h + IPlugin.h + IShell.h + IStateControl.h + IStateController.h + ISubSystem.h + IVirtualInput.h + Module.h + ) + +# when compiling proxy/stubs we should ignore deprecated warnings (which are treated as erros nowadays) +# as usage of those deprecated methods is valid here +target_compile_options(${TARGET_PROXYSTUBS} PRIVATE -Wno-deprecated-declarations) + +target_link_libraries(${TARGET_PROXYSTUBS} + PRIVATE + CompileSettingsDebug::CompileSettingsDebug + ${NAMESPACE}Core::${NAMESPACE}Core + ${NAMESPACE}COM::${NAMESPACE}COM + ${NAMESPACE}Messaging::${NAMESPACE}Messaging + ) + +target_include_directories( ${TARGET_PROXYSTUBS} + PRIVATE + $ + $ + ) + +set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED YES + FRAMEWORK FALSE + SOVERSION ${VERSION_MAJOR} + ) + +# =========================================================================================== +# Install ARTIFACTS: +# =========================================================================================== +install( + TARGETS ${TARGET} + EXPORT ${NAMESPACE}PluginsTargets + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces +) + +install( + FILES ${PUBLIC_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces + COMPONENT ${NAMESPACE}_Development +) + +install( + FILES ${JSON_DATA_HEADERS} ${JSON_CODE_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces/json + COMPONENT ${NAMESPACE}_Development +) + +install( + TARGETS ${TARGET_PROXYSTUBS} EXPORT ${TARGET_PROXYSTUBS}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces +) +# =========================================================================================== +# Install METADATA: +# =========================================================================================== + +InstallCMakeConfig(TARGETS ${TARGET_PROXYSTUBS}) \ No newline at end of file diff --git a/Source/plugins/IController.h b/Source/interfaces/IController.h similarity index 99% rename from Source/plugins/IController.h rename to Source/interfaces/IController.h index 8266e0dafb..ca82551b1c 100644 --- a/Source/plugins/IController.h +++ b/Source/interfaces/IController.h @@ -21,8 +21,8 @@ #include "Module.h" #include "IShell.h" -// @stubgen:include -// @stubgen:include +// @stubgen:include +// @stubgen:include // @stubgen:include namespace Thunder { diff --git a/Source/plugins/IDispatcher.h b/Source/interfaces/IDispatcher.h similarity index 98% rename from Source/plugins/IDispatcher.h rename to Source/interfaces/IDispatcher.h index 139069ccbb..b276d1dbe8 100644 --- a/Source/plugins/IDispatcher.h +++ b/Source/interfaces/IDispatcher.h @@ -22,7 +22,7 @@ #include #include "IShell.h" -// @stubgen:include +// @stubgen:include namespace Thunder { diff --git a/Source/plugins/IPlugin.h b/Source/interfaces/IPlugin.h similarity index 100% rename from Source/plugins/IPlugin.h rename to Source/interfaces/IPlugin.h diff --git a/Source/plugins/IShell.h b/Source/interfaces/IShell.h similarity index 100% rename from Source/plugins/IShell.h rename to Source/interfaces/IShell.h diff --git a/Source/plugins/IStateControl.h b/Source/interfaces/IStateControl.h similarity index 100% rename from Source/plugins/IStateControl.h rename to Source/interfaces/IStateControl.h diff --git a/Source/plugins/IStateController.h b/Source/interfaces/IStateController.h similarity index 100% rename from Source/plugins/IStateController.h rename to Source/interfaces/IStateController.h diff --git a/Source/plugins/ISubSystem.h b/Source/interfaces/ISubSystem.h similarity index 100% rename from Source/plugins/ISubSystem.h rename to Source/interfaces/ISubSystem.h diff --git a/Source/plugins/IVirtualInput.h b/Source/interfaces/IVirtualInput.h similarity index 100% rename from Source/plugins/IVirtualInput.h rename to Source/interfaces/IVirtualInput.h diff --git a/Source/interfaces/Module.cpp b/Source/interfaces/Module.cpp new file mode 100644 index 0000000000..3ed2aec49a --- /dev/null +++ b/Source/interfaces/Module.cpp @@ -0,0 +1,22 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2020 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#include "Module.h" + +MODULE_NAME_DECLARATION(BUILD_REFERENCE) \ No newline at end of file diff --git a/Source/interfaces/Module.h b/Source/interfaces/Module.h new file mode 100644 index 0000000000..cf882ce113 --- /dev/null +++ b/Source/interfaces/Module.h @@ -0,0 +1,33 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2025 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifndef MODULE_NAME +#define MODULE_NAME Interfaces +#endif + +#include +#include +#include + +#if defined(__WINDOWS__) && defined(INTERFACES_EXPORTS) +#undef EXTERNAL +#define EXTERNAL EXTERNAL_EXPORT +#endif \ No newline at end of file diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt index e0ca1fdd9e..d552f0fdc8 100644 --- a/Source/plugins/CMakeLists.txt +++ b/Source/plugins/CMakeLists.txt @@ -16,25 +16,11 @@ # limitations under the License. set(TARGET ${NAMESPACE}Plugins) -set(TARGET_PROXYSTUBS ${NAMESPACE}ProxyStubs) string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) option(VIRTUALINPUT_TOOLS "Build VirtualInput tools" OFF) -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IPlugin.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IShell.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::Exchange" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateControl.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IStateController.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/ISubSystem.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") -ProxyStubGenerator(NAMESPACE "Thunder::PluginHost" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/IDispatcher.h" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..") - -JsonGenerator(CODE NAMESPACE Thunder::Exchange::Controller INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) -JsonGenerator(CODE NAMESPACE Thunder::PluginHost INPUT ${CMAKE_CURRENT_SOURCE_DIR}/IStateController.h OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/json" INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." NO_INCLUDES) - -file(GLOB JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/json/JsonEnum_*.cpp") -file(GLOB JSON_DATA_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/json/JsonData_*.h" "${CMAKE_CURRENT_BINARY_DIR}/json/json_*.h") -list(APPEND JSON_CODE_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/json/JStateController.h") +file(GLOB JSON_ENUM_SOURCES "${CMAKE_BINARY_DIR}/Source/interfaces/json/JsonEnum_*.cpp") add_library(${TARGET} SHARED Channel.cpp @@ -50,24 +36,11 @@ add_library(${TARGET} SHARED ${JSON_ENUM_SOURCES} ) -file(GLOB PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/ProxyStubs*.cpp") -add_library(${TARGET_PROXYSTUBS} SHARED - ${PROXY_STUB_SOURCES} - Module.cpp - ) - set(PUBLIC_HEADERS Channel.h Config.h Configuration.h - IPlugin.h - IShell.h - IController.h - IStateControl.h - IStateController.h StateControl.h - ISubSystem.h - IDispatcher.h SubSystem.h JSONRPC.h Metadata.h @@ -77,7 +50,6 @@ set(PUBLIC_HEADERS System.h Types.h VirtualInput.h - IVirtualInput.h Module.h ) @@ -88,6 +60,7 @@ target_link_libraries(${TARGET} ${NAMESPACE}Messaging::${NAMESPACE}Messaging ${NAMESPACE}COM::${NAMESPACE}COM ${NAMESPACE}WebSocket::${NAMESPACE}WebSocket + ${NAMESPACE}Interfaces PRIVATE CompileSettingsDebug::CompileSettingsDebug ) @@ -99,29 +72,12 @@ if (WARNING_REPORTING) ) endif() -# when compiling proxy/stubs we should ignore deprecated warnings (which are treated as erros nowadays) -# as usage of those deprecated methods is valid here -target_compile_options(${TARGET_PROXYSTUBS} PRIVATE -Wno-deprecated-declarations) - -target_link_libraries(${TARGET_PROXYSTUBS} - PRIVATE - CompileSettingsDebug::CompileSettingsDebug - ${NAMESPACE}Core::${NAMESPACE}Core - ${NAMESPACE}COM::${NAMESPACE}COM - ${NAMESPACE}Messaging::${NAMESPACE}Messaging - ) - target_include_directories( ${TARGET} PUBLIC $ - $ + $ $ - ) - -target_include_directories( ${TARGET_PROXYSTUBS} - PRIVATE - $ - $ + $ ) set_target_properties(${TARGET} PROPERTIES @@ -138,18 +94,6 @@ set_target_properties(${TARGET} PROPERTIES ) endif() -set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES - CXX_STANDARD 11 - CXX_STANDARD_REQUIRED YES - FRAMEWORK FALSE - SOVERSION ${VERSION_MAJOR} - ) - -if(HUMAN_VERSIONED_BINARIES) -set_target_properties(${TARGET} PROPERTIES - VERSION ${VERSION} - ) -endif() # =========================================================================================== # Install ARTIFACTS: @@ -164,21 +108,6 @@ install( INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE} ) -install( - FILES ${JSON_DATA_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/plugins/json COMPONENT ${NAMESPACE}_Development - FILES ${JSON_CODE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/plugins/json COMPONENT ${NAMESPACE}_Development -) - -install( - TARGETS ${TARGET_PROXYSTUBS} EXPORT ${TARGET_PROXYSTUBS}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Development - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime - FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/proxystubs COMPONENT ${NAMESPACE}_Development - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/proxystubs -) - # =========================================================================================== # Install METADATA: # =========================================================================================== @@ -188,6 +117,4 @@ InstallPackageConfig( InstallCMakeConfig( EXTRA_DEPENDENCIES "ConfigGenerator" - TARGETS ${TARGET}) - -InstallCMakeConfig(TARGETS ${TARGET_PROXYSTUBS}) + TARGETS ${TARGET}) \ No newline at end of file diff --git a/Source/plugins/Configuration.h b/Source/plugins/Configuration.h index fb9dacffd3..5baa4e098f 100644 --- a/Source/plugins/Configuration.h +++ b/Source/plugins/Configuration.h @@ -21,10 +21,10 @@ #include "Module.h" #include "Config.h" -#include "IPlugin.h" -#include "IShell.h" -#include "ISubSystem.h" -#include "IController.h" +#include "interfaces/IPlugin.h" +#include "interfaces/IShell.h" +#include "interfaces/ISubSystem.h" +#include "interfaces/IController.h" namespace Thunder { namespace Plugin { diff --git a/Source/plugins/Metadata.cpp b/Source/plugins/Metadata.cpp index eeae04ba2e..9941e3449f 100644 --- a/Source/plugins/Metadata.cpp +++ b/Source/plugins/Metadata.cpp @@ -19,8 +19,8 @@ #include "Module.h" #include "Metadata.h" -#include "IStateControl.h" -#include "ISubSystem.h" +#include "interfaces/IStateControl.h" +#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/Metadata.h b/Source/plugins/Metadata.h index a064f29653..43eaf02b81 100644 --- a/Source/plugins/Metadata.h +++ b/Source/plugins/Metadata.h @@ -23,8 +23,8 @@ #include "Configuration.h" #include "IController.h" -#include -#include +#include +#include namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/Module.cpp b/Source/plugins/Module.cpp index 0e416f9b22..efd11b4046 100644 --- a/Source/plugins/Module.cpp +++ b/Source/plugins/Module.cpp @@ -18,6 +18,6 @@ */ #include "Module.h" -#include "IController.h" +#include "interfaces/IController.h" MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/Source/plugins/Service.h b/Source/plugins/Service.h index 3ff8121c62..04c945c568 100644 --- a/Source/plugins/Service.h +++ b/Source/plugins/Service.h @@ -24,8 +24,8 @@ #include "Configuration.h" #include "Metadata.h" #include "System.h" -#include "IPlugin.h" -#include "IShell.h" +#include "interfaces/IPlugin.h" +#include "interfaces/IShell.h" namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/Shell.cpp b/Source/plugins/Shell.cpp index 045ae792f0..493b4e58a7 100644 --- a/Source/plugins/Shell.cpp +++ b/Source/plugins/Shell.cpp @@ -18,7 +18,7 @@ */ #include "Module.h" -#include "IShell.h" +#include "interfaces/IShell.h" #include "Configuration.h" namespace Thunder { diff --git a/Source/plugins/StateControl.cpp b/Source/plugins/StateControl.cpp index 3e67115c29..81bae5ce82 100644 --- a/Source/plugins/StateControl.cpp +++ b/Source/plugins/StateControl.cpp @@ -18,7 +18,7 @@ */ #include "Module.h" -#include "IStateControl.h" +#include "interfaces/IStateControl.h" namespace Thunder { diff --git a/Source/plugins/StateControl.h b/Source/plugins/StateControl.h index 99854a1bfc..4a91249fb0 100644 --- a/Source/plugins/StateControl.h +++ b/Source/plugins/StateControl.h @@ -20,7 +20,7 @@ #pragma once #include "Module.h" -#include "IStateControl.h" +#include "interfaces/IStateControl.h" namespace Thunder { diff --git a/Source/plugins/SubSystem.cpp b/Source/plugins/SubSystem.cpp index 312a6809c4..caa87b7d56 100644 --- a/Source/plugins/SubSystem.cpp +++ b/Source/plugins/SubSystem.cpp @@ -18,7 +18,7 @@ */ #include "Module.h" -#include "ISubSystem.h" +#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/SubSystem.h b/Source/plugins/SubSystem.h index abacbecfba..9710c3770a 100644 --- a/Source/plugins/SubSystem.h +++ b/Source/plugins/SubSystem.h @@ -20,7 +20,7 @@ #pragma once #include "Module.h" -#include "ISubSystem.h" +#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/Types.h b/Source/plugins/Types.h index d33d0e3ab4..5c0c24ec84 100644 --- a/Source/plugins/Types.h +++ b/Source/plugins/Types.h @@ -20,8 +20,8 @@ #include "Module.h" -#include "IPlugin.h" -#include "IShell.h" +#include "interfaces/IPlugin.h" +#include "interfaces/IShell.h" namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/VirtualInput.h b/Source/plugins/VirtualInput.h index eed8bd3bc8..14bf712489 100644 --- a/Source/plugins/VirtualInput.h +++ b/Source/plugins/VirtualInput.h @@ -23,7 +23,7 @@ #define __VIRTUAL_INPUT__ #include "Module.h" -#include "IVirtualInput.h" +#include "interfaces/IVirtualInput.h" namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/definitions.h b/Source/plugins/definitions.h index 9ce2219b23..6e44bb5bca 100644 --- a/Source/plugins/definitions.h +++ b/Source/plugins/definitions.h @@ -22,5 +22,5 @@ // Generated files include this #include -#include -#include +#include +#include diff --git a/Source/plugins/plugins.h b/Source/plugins/plugins.h index 70f6ac353c..616f21545c 100644 --- a/Source/plugins/plugins.h +++ b/Source/plugins/plugins.h @@ -31,14 +31,7 @@ #include "Config.h" #include "Channel.h" #include "Configuration.h" -#include "IController.h" -#include "IPlugin.h" -#include "IShell.h" -#include "IStateControl.h" -#include "ISubSystem.h" -#include "IVirtualInput.h" #include "JSONRPC.h" -#include "IStateController.h" #include "Metadata.h" #include "Request.h" #include "Service.h" From 51846bbfed36f4ff35098b15e788645a1dc6b3df Mon Sep 17 00:00:00 2001 From: nxtumUbun Date: Sun, 16 Nov 2025 11:56:41 -0800 Subject: [PATCH 2/2] maybe working --- Source/Thunder/Module.h | 1 + Source/interfaces/CMakeLists.txt | 80 +++++++++++++++++++++----------- Source/interfaces/IController.h | 2 +- Source/interfaces/Module.h | 2 - Source/interfaces/interfaces.h | 42 +++++++++++++++++ Source/plugins/CMakeLists.txt | 2 +- Source/plugins/Configuration.h | 4 -- Source/plugins/JSONRPC.h | 3 -- Source/plugins/Metadata.cpp | 2 - Source/plugins/Metadata.h | 1 - Source/plugins/Module.cpp | 3 +- Source/plugins/Module.h | 1 + Source/plugins/Service.h | 2 - Source/plugins/Shell.cpp | 1 - Source/plugins/StateControl.cpp | 1 - Source/plugins/StateControl.h | 1 - Source/plugins/SubSystem.cpp | 1 - Source/plugins/SubSystem.h | 1 - Source/plugins/Types.h | 3 -- Source/plugins/VirtualInput.h | 1 - Source/plugins/definitions.h | 2 +- Source/plugins/plugins.h | 2 +- 22 files changed, 103 insertions(+), 55 deletions(-) create mode 100644 Source/interfaces/interfaces.h diff --git a/Source/Thunder/Module.h b/Source/Thunder/Module.h index f95bf5b3cb..09cb50fa42 100644 --- a/Source/Thunder/Module.h +++ b/Source/Thunder/Module.h @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef __CORE_WARNING_REPORTING__ #include diff --git a/Source/interfaces/CMakeLists.txt b/Source/interfaces/CMakeLists.txt index 8b3fd9feb9..c0857992e4 100644 --- a/Source/interfaces/CMakeLists.txt +++ b/Source/interfaces/CMakeLists.txt @@ -1,7 +1,7 @@ # If not stated otherwise in this file or this component's license file the # following copyright and licenses apply: # -# Copyright 2020 Metrological +# Copyright 2025 Metrological # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(TARGET ${NAMESPACE}Interfaces) +set(TARGET ${NAMESPACE}Interfaces) set(TARGET_PROXYSTUBS ${NAMESPACE}ProxyStubs) string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) @@ -39,10 +39,8 @@ add_library(${TARGET_PROXYSTUBS} SHARED Module.cpp ) -add_library(${TARGET} INTERFACE) -target_include_directories(${TARGET} INTERFACE - $ - $ +add_library(${TARGET} SHARED + Module.cpp ) set(PUBLIC_HEADERS @@ -54,10 +52,11 @@ set(PUBLIC_HEADERS IStateController.h ISubSystem.h IVirtualInput.h + interfaces.h Module.h ) -# when compiling proxy/stubs we should ignore deprecated warnings (which are treated as erros nowadays) +# when compiling proxy/stubs we should ignore deprecated warnings (which are treated as errors nowadays) # as usage of those deprecated methods is valid here target_compile_options(${TARGET_PROXYSTUBS} PRIVATE -Wno-deprecated-declarations) @@ -69,12 +68,27 @@ target_link_libraries(${TARGET_PROXYSTUBS} ${NAMESPACE}Messaging::${NAMESPACE}Messaging ) +target_link_libraries(${TARGET} + PUBLIC + ${NAMESPACE}Core::${NAMESPACE}Core + ${NAMESPACE}COM::${NAMESPACE}COM + PRIVATE + CompileSettingsDebug::CompileSettingsDebug + ) + target_include_directories( ${TARGET_PROXYSTUBS} PRIVATE $ $ ) +target_include_directories( ${TARGET} + PUBLIC + $ + $ + $ + ) + set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES @@ -82,36 +96,50 @@ set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES SOVERSION ${VERSION_MAJOR} ) +set_target_properties(${TARGET} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED YES + FRAMEWORK FALSE + PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers + SOVERSION ${VERSION_MAJOR} + ) + +if(HUMAN_VERSIONED_BINARIES) +set_target_properties(${TARGET} PROPERTIES + VERSION ${VERSION} + ) +endif() # =========================================================================================== # Install ARTIFACTS: # =========================================================================================== install( - TARGETS ${TARGET} - EXPORT ${NAMESPACE}PluginsTargets - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces -) - -install( - FILES ${PUBLIC_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces - COMPONENT ${NAMESPACE}_Development + TARGETS ${TARGET} EXPORT ${TARGET}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${NAMESPACE}_Development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime + FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces COMPONENT ${NAMESPACE}_Development + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE} ) - + install( - FILES ${JSON_DATA_HEADERS} ${JSON_CODE_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces/json - COMPONENT ${NAMESPACE}_Development + FILES ${JSON_DATA_HEADERS} ${JSON_CODE_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces/json + COMPONENT ${NAMESPACE}_Development ) - + install( - TARGETS ${TARGET_PROXYSTUBS} EXPORT ${TARGET_PROXYSTUBS}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Development - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces + TARGETS ${TARGET_PROXYSTUBS} EXPORT ${TARGET_PROXYSTUBS}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime NAMELINK_COMPONENT ${NAMESPACE}_Development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${NAMESPACE}_Runtime + FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Runtime + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/proxystubs COMPONENT ${NAMESPACE}_Development + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/proxystubs ) # =========================================================================================== # Install METADATA: # =========================================================================================== +InstallCMakeConfig(TARGETS ${TARGET}) InstallCMakeConfig(TARGETS ${TARGET_PROXYSTUBS}) \ No newline at end of file diff --git a/Source/interfaces/IController.h b/Source/interfaces/IController.h index ea8fed5d1b..c14c3c195b 100644 --- a/Source/interfaces/IController.h +++ b/Source/interfaces/IController.h @@ -405,4 +405,4 @@ namespace Controller { } // namespace Exchange -} +} \ No newline at end of file diff --git a/Source/interfaces/Module.h b/Source/interfaces/Module.h index cf882ce113..6af09223af 100644 --- a/Source/interfaces/Module.h +++ b/Source/interfaces/Module.h @@ -24,8 +24,6 @@ #endif #include -#include -#include #if defined(__WINDOWS__) && defined(INTERFACES_EXPORTS) #undef EXTERNAL diff --git a/Source/interfaces/interfaces.h b/Source/interfaces/interfaces.h new file mode 100644 index 0000000000..a42200d567 --- /dev/null +++ b/Source/interfaces/interfaces.h @@ -0,0 +1,42 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2025 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + #pragma once + + #ifndef MODULE_NAME + #error "Please define a MODULE_NAME that describes the binary/library you are building." + #endif + + // Since this header is included, the code using it is external to Thunder core. + // So therefore it should use the correct Tracing functionality and not TRACE_L# (which are just fancy printfs). + #define CORE_TRACE_NOT_ALLOWED + +#include "Module.h" +#include "IController.h" +#include "IPlugin.h" +#include "IShell.h" +#include "IStateControl.h" +#include "ISubSystem.h" +#include "IVirtualInput.h" +#include "IStateController.h" +#include "IDispatcher.h" + +#ifdef __WINDOWS__ +#pragma comment(lib, "interfaces.lib") +#endif \ No newline at end of file diff --git a/Source/plugins/CMakeLists.txt b/Source/plugins/CMakeLists.txt index d552f0fdc8..573bb3799f 100644 --- a/Source/plugins/CMakeLists.txt +++ b/Source/plugins/CMakeLists.txt @@ -60,7 +60,7 @@ target_link_libraries(${TARGET} ${NAMESPACE}Messaging::${NAMESPACE}Messaging ${NAMESPACE}COM::${NAMESPACE}COM ${NAMESPACE}WebSocket::${NAMESPACE}WebSocket - ${NAMESPACE}Interfaces + ${NAMESPACE}Interfaces::${NAMESPACE}Interfaces PRIVATE CompileSettingsDebug::CompileSettingsDebug ) diff --git a/Source/plugins/Configuration.h b/Source/plugins/Configuration.h index 5baa4e098f..c038eb1aed 100644 --- a/Source/plugins/Configuration.h +++ b/Source/plugins/Configuration.h @@ -21,10 +21,6 @@ #include "Module.h" #include "Config.h" -#include "interfaces/IPlugin.h" -#include "interfaces/IShell.h" -#include "interfaces/ISubSystem.h" -#include "interfaces/IController.h" namespace Thunder { namespace Plugin { diff --git a/Source/plugins/JSONRPC.h b/Source/plugins/JSONRPC.h index 139756bc56..b1d7465db9 100644 --- a/Source/plugins/JSONRPC.h +++ b/Source/plugins/JSONRPC.h @@ -21,9 +21,6 @@ #include "Module.h" #include "System.h" -#include "IShell.h" -#include "IPlugin.h" -#include "IDispatcher.h" namespace Thunder { diff --git a/Source/plugins/Metadata.cpp b/Source/plugins/Metadata.cpp index 9941e3449f..b1f8883f50 100644 --- a/Source/plugins/Metadata.cpp +++ b/Source/plugins/Metadata.cpp @@ -19,8 +19,6 @@ #include "Module.h" #include "Metadata.h" -#include "interfaces/IStateControl.h" -#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/Metadata.h b/Source/plugins/Metadata.h index 43eaf02b81..e701cca873 100644 --- a/Source/plugins/Metadata.h +++ b/Source/plugins/Metadata.h @@ -22,7 +22,6 @@ #include "Module.h" #include "Configuration.h" -#include "IController.h" #include #include diff --git a/Source/plugins/Module.cpp b/Source/plugins/Module.cpp index efd11b4046..a2c6804a2d 100644 --- a/Source/plugins/Module.cpp +++ b/Source/plugins/Module.cpp @@ -18,6 +18,5 @@ */ #include "Module.h" -#include "interfaces/IController.h" -MODULE_NAME_DECLARATION(BUILD_REFERENCE) +MODULE_NAME_DECLARATION(BUILD_REFERENCE) \ No newline at end of file diff --git a/Source/plugins/Module.h b/Source/plugins/Module.h index ec4e75fd31..c0c1c1610f 100644 --- a/Source/plugins/Module.h +++ b/Source/plugins/Module.h @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef __CORE_WARNING_REPORTING__ #include diff --git a/Source/plugins/Service.h b/Source/plugins/Service.h index f49b13976b..6cf8dee1a8 100644 --- a/Source/plugins/Service.h +++ b/Source/plugins/Service.h @@ -24,8 +24,6 @@ #include "Configuration.h" #include "Metadata.h" #include "System.h" -#include "interfaces/IPlugin.h" -#include "interfaces/IShell.h" namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/Shell.cpp b/Source/plugins/Shell.cpp index 493b4e58a7..82f946f976 100644 --- a/Source/plugins/Shell.cpp +++ b/Source/plugins/Shell.cpp @@ -18,7 +18,6 @@ */ #include "Module.h" -#include "interfaces/IShell.h" #include "Configuration.h" namespace Thunder { diff --git a/Source/plugins/StateControl.cpp b/Source/plugins/StateControl.cpp index 81bae5ce82..2bf498b83a 100644 --- a/Source/plugins/StateControl.cpp +++ b/Source/plugins/StateControl.cpp @@ -18,7 +18,6 @@ */ #include "Module.h" -#include "interfaces/IStateControl.h" namespace Thunder { diff --git a/Source/plugins/StateControl.h b/Source/plugins/StateControl.h index 4a91249fb0..d58f010556 100644 --- a/Source/plugins/StateControl.h +++ b/Source/plugins/StateControl.h @@ -20,7 +20,6 @@ #pragma once #include "Module.h" -#include "interfaces/IStateControl.h" namespace Thunder { diff --git a/Source/plugins/SubSystem.cpp b/Source/plugins/SubSystem.cpp index caa87b7d56..c6a186e3a4 100644 --- a/Source/plugins/SubSystem.cpp +++ b/Source/plugins/SubSystem.cpp @@ -18,7 +18,6 @@ */ #include "Module.h" -#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/SubSystem.h b/Source/plugins/SubSystem.h index 9710c3770a..d15284ba6f 100644 --- a/Source/plugins/SubSystem.h +++ b/Source/plugins/SubSystem.h @@ -20,7 +20,6 @@ #pragma once #include "Module.h" -#include "interfaces/ISubSystem.h" namespace Thunder { diff --git a/Source/plugins/Types.h b/Source/plugins/Types.h index 5c0c24ec84..764cc18df0 100644 --- a/Source/plugins/Types.h +++ b/Source/plugins/Types.h @@ -20,9 +20,6 @@ #include "Module.h" -#include "interfaces/IPlugin.h" -#include "interfaces/IShell.h" - namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/VirtualInput.h b/Source/plugins/VirtualInput.h index 14bf712489..a96fc18ace 100644 --- a/Source/plugins/VirtualInput.h +++ b/Source/plugins/VirtualInput.h @@ -23,7 +23,6 @@ #define __VIRTUAL_INPUT__ #include "Module.h" -#include "interfaces/IVirtualInput.h" namespace Thunder { namespace PluginHost { diff --git a/Source/plugins/definitions.h b/Source/plugins/definitions.h index 6e44bb5bca..7c25682590 100644 --- a/Source/plugins/definitions.h +++ b/Source/plugins/definitions.h @@ -23,4 +23,4 @@ #include #include -#include +#include \ No newline at end of file diff --git a/Source/plugins/plugins.h b/Source/plugins/plugins.h index 616f21545c..2a1910bed8 100644 --- a/Source/plugins/plugins.h +++ b/Source/plugins/plugins.h @@ -46,4 +46,4 @@ #endif WPEFRAMEWORK_NESTEDNAMESPACE_COMPATIBILIY(Plugin) -WPEFRAMEWORK_NESTEDNAMESPACE_COMPATIBILIY(PluginHost) +WPEFRAMEWORK_NESTEDNAMESPACE_COMPATIBILIY(PluginHost) \ No newline at end of file