Skip to content

Commit

Permalink
Development/cmake winter cleanup (rdkcentral#1454)
Browse files Browse the repository at this point in the history
* config: remove EXTERN_EVENTS

* cmake: remove useless check

Signed-off-by: Bram Oosterhuis <[email protected]>

* CMake: remove setting the CMAKE_BUILD_TYPE

* Tests: Add comrpctester

---------

Signed-off-by: Bram Oosterhuis <[email protected]>
  • Loading branch information
bramoosterhuis committed Apr 26, 2024
1 parent a3ad237 commit 4a1243b
Show file tree
Hide file tree
Showing 8 changed files with 793 additions and 21 deletions.
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ option(LEGACY_CONFIG_GENERATOR
option(BUILD_PLUGIN_ACTIVATOR
"Build the standalone plugin activator utility to activate plugins using systemd" OFF)


if (BUILD_REFERENCE)
add_definitions (-DBUILD_REFERENCE=${BUILD_REFERENCE})
endif()
Expand Down Expand Up @@ -78,16 +77,7 @@ if(NOT CMAKE_BUILD_TYPE)
message(AUTHOR_WARNING "CMAKE_BUILD_TYPE not set, assuming '${CMAKE_BUILD_TYPE}'")
endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "DebugOptimized" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR
"${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")

message(STATUS "CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'")
else()
message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'")
endif()
message(STATUS "CMake build type: '${CMAKE_BUILD_TYPE}'")

# Remove optimization flags added by the build system
string(REGEX REPLACE "(-g[0123])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
Expand Down
5 changes: 0 additions & 5 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ if(ENABLE_STRICT_COMPILER_SETTINGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_STRICT_COMPILER_SETTINGS}")
endif()

set(EXTERN_EVENTS ${EXTERN_EVENTS} CACHE INTERNAL
"List of events assumed to be provided by other plugins.")
string(REPLACE " " ";" EXTERN_EVENT_LIST "${EXTERN_EVENTS}")
message(STATUS "Assuming external events: ${EXTERN_EVENT_LIST}")

if(CORE)
add_subdirectory(core)
endif()
Expand Down
2 changes: 1 addition & 1 deletion Source/WPEFramework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ install(DIRECTORY
if (ENABLE_INITSCRIPT_SUPPORT)
add_subdirectory(scripts)
endif()
include(GenericConfig.cmake)

include(GenericConfig.cmake)
2 changes: 0 additions & 2 deletions Source/WPEFramework/WPEFramework.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ exitreasons = __exitreasons.split(';')

__plugins = []

__subsystems = '@EXTERN_EVENTS@'
__resumes = []

if boolean('@PLUGIN_WEBKITBROWSER@'):
Expand All @@ -46,7 +45,6 @@ if boolean('@PLUGIN_WEBSERVER@'):
__resumes.append("WebServer")

__controller_plugin_configuration = JSON()
__controller_plugin_configuration.add("subsystems", __subsystems.split(' '))
__controller_plugin_configuration.add("resumes", __resumes)

__controller_plugin = JSON()
Expand Down
32 changes: 32 additions & 0 deletions Tests/comrpctester/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# If not stated otherwise in this file or this component's license file the
# following copyright and licenses apply:
#
# Copyright 2023 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.

add_executable(comrpctester main.cpp)

target_link_libraries(comrpctester
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}COM::${NAMESPACE}COM
)

set_target_properties(comrpctester PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
)

install(TARGETS comrpctester DESTINATION bin)

66 changes: 66 additions & 0 deletions Tests/comrpctester/comprc-test-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"version": "1.0.",
"port": 55555,
"binding": "127.0.0.1",
"ipv6": false,
"idletime": 180,
"softkillcheckwaittime": 10,
"hardkillcheckwaittime": 4,
"persistentpath": "/home/bram/Projects/metrological/Thunder/install/var/wpeframework/WPEFramework",
"volatilepath": "/tmp",
"datapath": "/home/bram/Projects/metrological/Thunder/install/usr/share/WPEFramework",
"systempath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/wpeframework/plugins",
"proxystubpath": "/home/bram/Projects/metrological/Thunder/install/usr/lib/wpeframework/proxystubs",
"postmortempath": "/opt/minidumps",
"redirect": "/Service/Controller/UI",
"communicator": "127.0.0.1:62000",
"process": {
"priority": 0,
"policy": "OTHER",
"oomadjust": 0,
"stacksize": 0
},
"exitreasons": [
"Failure",
"MemoryExceeded",
"WatchdogExpired"
],
"plugins": [
{
"callsign": "Controller",
"configuration": {
"subsystems": [
""
]
}
}
],
"messaging": {
"logging": {
"abbreviated": true,
"settings": [
{
"category": "Notification",
"enabled": false
}
]
},
"tracing": {
"settings": [
{
"category": "Fatal",
"enabled": true
}
]
},
"reporting": {
"abbreviated": true,
"settings": [
{
"category": "TooLongWaitingForLock",
"enabled": true
}
]
}
}
}
Loading

0 comments on commit 4a1243b

Please sign in to comment.