Skip to content

Commit 80c155f

Browse files
VeithMetroCopilot
andauthored
[Actions][Linux] Add more plugins to be built, fix all compile warnings and errors (#946)
* Fix all the build issues to make it possible to build more stuff in Actions * Update Linux build template with new packages and plugins Added additional packages and plugin options for build. * Update ThunderNanoServices workflow to use development branch * Fix PKG_CONFIG_PATH export for architecture * Fix some compile errors on the MinSizeRel version * Use PRIu64 to print long long unsigned int to work on both 32 and 64 bit * Use the macro to suppress the release warning instead * Update ThunderNanoServices workflow to use master branch * Update examples/IOConnectorTest/CMakeLists.txt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update examples/IOConnectorTest/Module.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Define EXTERNAL in Module.h --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 623e372 commit 80c155f

File tree

17 files changed

+180
-19
lines changed

17 files changed

+180
-19
lines changed

.github/workflows/Linux build template.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ jobs:
4444
PKGS="python3-venv python3-pip build-essential cmake ninja-build libusb-1.0-0-dev"
4545
if [ "${{ matrix.architecture }}" = "32" ]; then
4646
PKGS="$PKGS zlib1g-dev:i386 libssl-dev:i386 libsbc-dev:i386 gcc-13-multilib g++-13-multilib"
47+
PKGS="$PKGS libicu-dev:i386 libpng-dev:i386 libdrm-dev:i386 libgbm-dev:i386 libegl-dev:i386 libgles2-mesa-dev:i386"
4748
else
4849
PKGS="$PKGS zlib1g-dev libssl-dev libsbc-dev"
50+
PKGS="$PKGS libicu-dev libpng-dev libdrm-dev libgbm-dev libegl-dev libgles2-mesa-dev"
4951
fi
5052
for attempt in {1..4}; do
5153
if sudo apt-get install -y --no-install-recommends $PKGS; then
@@ -94,18 +96,32 @@ jobs:
9496
- name: Build ThunderNanoServices
9597
run: |
9698
source venv/bin/activate
99+
${{matrix.architecture == '32' && 'export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig:$PKG_CONFIG_PATH' || 'PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH'}}
97100
cmake -G Ninja -S ThunderNanoServices -B ${{matrix.build_type}}/build/ThunderNanoServices \
98101
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
99102
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
100103
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
101104
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
105+
-DEXAMPLE_CLIENT_SERVER=ON \
102106
-DEXAMPLE_COMRPCCLIENT=ON \
107+
-DEXAMPLE_CUSTOMCODE_EXAMPLE=ON \
108+
-DEXAMPLE_DYNAMICJSONRPCERRORMESSAGE_EXAMPLE=ON \
109+
-DEXAMPLE_DYNAMICLOADING=ON \
110+
-DEXAMPLE_DYNAMICLOADING_YIN=ON \
111+
-DEXAMPLE_DYNAMICLOADING_YANG=ON \
112+
-DEXAMPLE_GENERATORSHOWCASE_EXAMPLE=ON \
113+
-DEXAMPLE_IOCONNECTOR_TEST=ON \
114+
-DEXAMPLE_MESSAGECONTROL_UDP_CLIENT=ON \
115+
-DEXAMPLE_PLUGINSMARTINTERFACETYPE_EXAMPLE=ON \
116+
-DEXAMPLE_SIMPLECOMRPC_TEST=ON \
103117
-DPLUGIN_BLUETOOTH=ON \
104118
-DPLUGIN_BLUETOOTHREMOTECONTROL=ON \
105119
-DPLUGIN_BLUETOOTHAUDIO=ON \
106120
-DPLUGIN_BLUETOOTHSDPSERVER=ON \
107121
-DPLUGIN_CECCONTROL=ON \
108122
-DPLUGIN_COMMANDER=ON \
123+
-DPLUGIN_COMPOSITOR=ON \
124+
-DPLUGIN_COMPOSITOR_IMPLEMENTATION=RPI \
109125
-DPLUGIN_CONFIGUPDATEEXAMPLE=ON \
110126
-DPLUGIN_DHCPSERVER=ON \
111127
-DPLUGIN_DIALSERVER=ON \
@@ -114,19 +130,32 @@ jobs:
114130
-DPLUGIN_INPUTSWITCH=ON \
115131
-DPLUGIN_IOCONNECTOR=ON \
116132
-DPLUGIN_JSONRPC=ON \
133+
-DPLUGIN_JSONRPCMUXER=ON \
134+
-DPLUGIN_LANGUAGEADMINISTRATOR=ON \
117135
-DPLUGIN_NETWORKCONTROL=ON \
118136
-DPLUGIN_OUTOFPROCESS=ON \
137+
-DPLUGIN_PERFORMANCEMONITOR=ON \
138+
-DPLUGIN_PLUGININITIALIZERSERVICE=ON \
139+
-DPLUGIN_POWER=ON \
140+
-DPLUGIN_PROCESSCONTAINERS=ON \
119141
-DPLUGIN_PROCESSMONITOR=ON \
142+
-DPLUGIN_REMOTECONTROL=ON \
120143
-DPLUGIN_RESOURCEMONITOR=ON \
144+
-DPLUGIN_SNAPSHOT=ON \
121145
-DPLUGIN_STATECONTROLLER=ON \
146+
-DPLUGIN_SUBSYSTEMCONTROLLER=ON \
122147
-DPLUGIN_SWITCHBOARD=ON \
123148
-DPLUGIN_SYSTEMCOMMANDS=ON \
124149
-DPLUGIN_TESTCONTROLLER=ON \
150+
-DPLUGIN_TESTPRIORITYQUEUE=ON \
151+
-DPLUGIN_TESTTEXTOPTIONS=ON \
125152
-DPLUGIN_TESTUTILITY=ON \
153+
-DPLUGIN_TIMESYNC=ON \
126154
-DPLUGIN_WEBPROXY=ON \
127155
-DPLUGIN_WEBSERVER=ON \
128156
-DPLUGIN_WEBSHELL=ON \
129157
-DPLUGIN_WIFICONTROL=ON \
158+
-DPLUGIN_VOLUMECONTROL=ON \
130159
-DSTORE_TEST=ON \
131160
-DTEST_AUTOMATION_TOOLS=ON \
132161
${{steps.plugins.outputs.first_match}}

Power/PowerImplementation/Linux/PowerImplementation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class PowerImplementation {
130130
if (_triggerFile < 0) {
131131
TRACE(Trace::Error, (_T("Not able to access %s."), TriggerFile));
132132
} else {
133+
PUSH_WARNING(DISABLE_WARNING_UNUSED_RESULT)
133134
::write(_triggerFile, "0", 1);
135+
POP_WARNING()
134136
}
135137
}
136138
}
@@ -213,6 +215,7 @@ class PowerImplementation {
213215
case Exchange::IPower::PCState::PassiveStandby: break;
214216
case Exchange::IPower::PCState::SuspendToRAM:
215217
{
218+
PUSH_WARNING(DISABLE_WARNING_UNUSED_RESULT)
216219
::write(_triggerFile, "1", 1);
217220
/* We will be able to write state only if we are in 'On' State. */
218221
::write(_stateFile, newMode->label, newMode->length);
@@ -221,14 +224,17 @@ class PowerImplementation {
221224
::read(_triggerFile, &value, 1);
222225
/* Reset the early wakeup trigger for low level drivers. */
223226
::write(_triggerFile, "0", 1);
227+
POP_WARNING()
224228
/* Reset the State to 'On' once device wakes-up. */
225229
RevokeJob();
226230
SetState(Exchange::IPower::PCState::On, 0);
227231
}
228232
break;
229233
case Exchange::IPower::PCState::Hibernate: break;
230234
case Exchange::IPower::PCState::PowerOff:
235+
PUSH_WARNING(DISABLE_WARNING_UNUSED_RESULT)
231236
system("poweroff");
237+
POP_WARNING()
232238
break;
233239
default:
234240
TRACE(Trace::Error, (_T("Should not reach here at any case...!!!")));

examples/DynamicLoading/Yin/YinImplementation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace Plugin {
200200
Core::File dataFile(_service->DataPath() + _dataFile);
201201

202202
if (dataFile.Open(true) == true) {
203-
const uint64_t size = std::min(dataFile.Size(), 4096ULL);
203+
const uint64_t size = std::min(dataFile.Size(), static_cast<uint64_t>(4096));
204204
uint8_t *data = static_cast<uint8_t*>(ALLOCA(size + 1));
205205
ASSERT(data != nullptr);
206206
dataFile.Read(data, size);

examples/IOConnectorTest/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ find_package(${NAMESPACE}Messaging REQUIRED)
3333
find_package(${NAMESPACE}WebSocket REQUIRED)
3434
find_package(CompileSettingsDebug CONFIG REQUIRED)
3535

36-
add_executable(${MODULE_NAME} IOConnectorTest.cpp)
36+
set(IOCONNECTOR_TEST_SOURCES
37+
IOConnectorTest.cpp
38+
Module.cpp
39+
)
40+
41+
add_executable(${MODULE_NAME} ${IOCONNECTOR_TEST_SOURCES})
3742

3843
set_target_properties(${MODULE_NAME} PROPERTIES
3944
CXX_STANDARD 11

examples/IOConnectorTest/IOConnectorTest.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20-
#ifndef MODULE_NAME
21-
#define MODULE_NAME IOConnectorTest
22-
#endif
23-
24-
#include <com/com.h>
25-
#include <core/core.h>
26-
#include <websocket/websocket.h>
27-
28-
#include <interfaces/IExternal.h>
29-
#include <interfaces/IInputPin.h>
20+
#include "Module.h"
3021

3122
#define INPUT_PIN_ID 16
3223
#define OUTPUT_PIN_ID 20
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2020 Metrological
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#include "Module.h"
21+
22+
MODULE_NAME_DECLARATION(BUILD_REFERENCE)

examples/IOConnectorTest/Module.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2020 Metrological
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#pragma once
21+
22+
#ifndef MODULE_NAME
23+
#define MODULE_NAME IOConnectorTest
24+
#endif
25+
26+
#include <com/com.h>
27+
#include <core/core.h>
28+
#include <websocket/websocket.h>
29+
30+
#include <interfaces/IExternal.h>
31+
#include <interfaces/IInputPin.h>
32+
33+
#undef EXTERNAL
34+
#define EXTERNAL

examples/SimpleCOMRPC/Client/SimpleCOMRPCClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ int main(int argc, char* argv[])
244244
printf("We do not have a clock interface, so we can not get the time\n");
245245
}
246246
else {
247-
printf("The Ticker is at: %lu\n", clock->Now());
247+
printf("The Ticker is at: %" PRIu64 "\n", clock->Now());
248248
}
249249
break;
250250
case 'T':

examples/SimpleCOMRPCServer/SimpleCOMRPCServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class COMServer : public RPC::Communicator {
4141
Notifier(const uint16_t period, Exchange::IWallClock::ICallback* callback)
4242
: _period(period)
4343
, _ticks(Core::Time::Now().Add(_period * 1000).Ticks())
44-
, _callback(_callback) {
44+
, _callback(callback) {
4545
_callback->AddRef();
4646
}
4747
~Notifier() {
@@ -242,7 +242,7 @@ POP_WARNING()
242242
}
243243

244244
private:
245-
void* Acquire(const string& className, const uint32_t interfaceId, const uint32_t versionId) override
245+
void* Acquire(const string& /* className */, const uint32_t interfaceId, const uint32_t versionId) override
246246
{
247247
void* result = nullptr;
248248

examples/testconsole/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ find_package(CompileSettingsDebug CONFIG REQUIRED)
1818

1919
set (PLUGIN_TEST_TESTCONSOLE_SOURCES
2020
testconsole.cpp
21+
Module.cpp
2122
../testserver/DataContainer.cpp
2223
)
2324

0 commit comments

Comments
 (0)