Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,6 +118,10 @@ if(COM)
add_subdirectory(com)
endif()

if(INTERFACES)
add_subdirectory(interfaces)
endif()

if(PLUGINS)
add_subdirectory(plugins)
endif()
Expand Down
2 changes: 1 addition & 1 deletion Source/Thunder/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "Controller.h"
#include "SystemInfo.h"

#include <plugins/json/json_IController.h>
#include <interfaces/json/json_IController.h>

namespace Thunder {

Expand Down
2 changes: 1 addition & 1 deletion Source/Thunder/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "IController.h"
#include "PostMortem.h"

#include <plugins/json/json_IController.h>
#include <interfaces/json/json_IController.h>

namespace Thunder {
namespace Plugin {
Expand Down
1 change: 1 addition & 0 deletions Source/Thunder/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <plugins/plugins.h>
#include <websocket/websocket.h>
#include <messaging/messaging.h>
#include <interfaces/interfaces.h>

#ifdef __CORE_WARNING_REPORTING__
#include <warningreporting/warningreporting.h>
Expand Down
145 changes: 145 additions & 0 deletions Source/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# 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.

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} SHARED
Module.cpp
)

set(PUBLIC_HEADERS
IController.h
IDispatcher.h
IPlugin.h
IShell.h
IStateControl.h
IStateController.h
ISubSystem.h
IVirtualInput.h
interfaces.h
Module.h
)

# when compiling proxy/stubs we should ignore deprecated warnings (which are treated as errors nowadays)
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "errors" should be "errors" is correct, but "erros" in the comment is misspelled.

Copilot uses AI. Check for mistakes.
# 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_link_libraries(${TARGET}
PUBLIC
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}COM::${NAMESPACE}COM
PRIVATE
CompileSettingsDebug::CompileSettingsDebug
)

target_include_directories( ${TARGET_PROXYSTUBS}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
)

target_include_directories( ${TARGET}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}>
)

set_target_properties(${TARGET_PROXYSTUBS} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
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 ${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
)

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:
# ===========================================================================================

InstallCMakeConfig(TARGETS ${TARGET})
InstallCMakeConfig(TARGETS ${TARGET_PROXYSTUBS})
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "Module.h"
#include "IShell.h"

// @stubgen:include <plugins/IShell.h>
// @stubgen:include <plugins/ISubSystem.h>
// @stubgen:include <interfaces/IShell.h>
// @stubgen:include <interfaces/ISubSystem.h>
// @stubgen:include <com/IIteratorType.h>

namespace Thunder {
Expand Down Expand Up @@ -405,4 +405,4 @@ namespace Controller {

} // namespace Exchange

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <com/ICOM.h>
#include "IShell.h"

// @stubgen:include <plugins/IShell.h>
// @stubgen:include <interfaces/IShell.h>

namespace Thunder {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions Source/interfaces/Module.cpp
Original file line number Diff line number Diff line change
@@ -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
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Copyright year inconsistency: This file has "Copyright 2020 Metrological" while other newly created files in the interfaces directory use "Copyright 2025 Metrological" (e.g., interfaces.h, Module.h). Consider using 2025 for consistency.

Suggested change
* Copyright 2020 Metrological
* Copyright 2025 Metrological

Copilot uses AI. Check for mistakes.
*
* 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)
31 changes: 31 additions & 0 deletions Source/interfaces/Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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 <core/core.h>

#if defined(__WINDOWS__) && defined(INTERFACES_EXPORTS)
#undef EXTERNAL
#define EXTERNAL EXTERNAL_EXPORT
#endif
42 changes: 42 additions & 0 deletions Source/interfaces/interfaces.h
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading