Skip to content

Commit 153e814

Browse files
workflows: remove CXX standard overrule, this is controlled by the cmakes internally (#956)
* cmake: Remove direct C/CXX flag manipulation Strict flags are now inherited via find_package(Thunder) when Thunder is built with ENABLE_STRICT_COMPILER_SETTINGS=ON, and can be opted out by setting ENABLE_STRICT_COMPILER_SETTINGS=OFF in a downstream project. * Update workflow to used the local path * workflows: remove strict C/CXX flags from the configure * workflows: remove CXX standard overrule, this is controlled by the cmakes internally * workflows: fix broken c flag * cmake: Add cppstd to libraries that were missing it.
1 parent 18f3176 commit 153e814

File tree

23 files changed

+72
-31
lines changed

23 files changed

+72
-31
lines changed

.github/workflows/Build ThunderNanoServices on Linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020

2121
ThunderNanoServices:
2222
needs: ThunderInterfaces
23-
uses: rdkcentral/ThunderNanoServices/.github/workflows/Linux build template.yml@master
23+
uses: ./.github/workflows/Linux build template.yml

.github/workflows/Build ThunderNanoServices on MacOS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020

2121
ThunderNanoServices_MacOS:
2222
needs: ThunderInterfaces_MacOS
23-
uses: rdkcentral/ThunderNanoServices/.github/workflows/MacOS build template.yml@master
23+
uses: ./.github/workflows/MacOS build template.yml

.github/workflows/Linux build template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
source venv/bin/activate
9999
${{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'}}
100100
cmake -G Ninja -S ThunderNanoServices -B ${{matrix.build_type}}/build/ThunderNanoServices \
101-
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
102-
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
101+
-DCMAKE_CXX_FLAGS="-m${{matrix.architecture}}" \
102+
-DCMAKE_C_FLAGS="-m${{matrix.architecture}}" \
103103
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
104104
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
105105
-DEXAMPLE_CLIENT_SERVER=ON \

.github/workflows/MacOS build template.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,8 @@ jobs:
5959
run: |
6060
source venv/bin/activate
6161
cmake -G Ninja -S ThunderNanoServices -B ${{matrix.build_type}}/build/ThunderNanoServices \
62-
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
63-
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
6462
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
6563
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
66-
-DCMAKE_CXX_STANDARD=11 \
67-
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
6864
-DEXAMPLE_COMRPCCLIENT=ON \
6965
-DPLUGIN_CECCONTROL=OFF \
7066
-DPLUGIN_COMMANDER=ON \

AVS/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,4 @@ target_link_libraries(${MODULE_NAME}
9292
install(TARGETS ${MODULE_NAME}
9393
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${STORAGE_DIRECTORY}/plugins COMPONENT ${NAMESPACE}_Runtime)
9494

95-
# TODO: remove me ;)
96-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
97-
9895
write_config()

CECControl/simpleworker/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ target_link_libraries(SimpleWorker
3434
${NAMESPACE}Core::${NAMESPACE}Core
3535
${NAMESPACE}Definitions::${NAMESPACE}Definitions)
3636

37+
set_target_properties(SimpleWorker PROPERTIES
38+
CXX_STANDARD ${CXX_STD}
39+
CXX_STANDARD_REQUIRED YES)
40+
3741
add_library(SimpleWorker::SimpleWorker ALIAS SimpleWorker)

CMakeLists.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,6 @@ option(PLUGIN_WEBSHELL "Include WebShell plugin" OFF)
6666
option(PLUGIN_WIFICONTROL "Include WifiControl plugin" OFF)
6767
option(PLUGIN_FILETRANSFER "Include FileTransfer plugin" OFF)
6868

69-
70-
if(ENABLE_STRICT_COMPILER_SETTINGS)
71-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
72-
message(FATAL_ERROR "Compiling with Clang")
73-
set(CMAKE_STRICT_COMPILER_SETTINGS "-Weverything -Wextra -Wpedantic -Werror")
74-
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
75-
elseif(${CMAKE_COMPILER_IS_GNUCXX})
76-
message(STATUS "Compiling with GCC")
77-
set(CMAKE_STRICT_COMPILER_SETTINGS "-Wall -Wextra -Wpedantic -Werror")
78-
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
79-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
80-
message(STATUS "Compiling with MS Visual Studio")
81-
set(CMAKE_STRICT_COMPILER_SETTINGS "/W4")
82-
else()
83-
message(STATUS "Compiler ${CMAKE_CXX_COMPILER_ID}")
84-
endif()
85-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_STRICT_CXX_COMPILER_SETTINGS}")
86-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_STRICT_COMPILER_SETTINGS}")
87-
endif()
88-
8969
if(PLUGIN_AVS)
9070
add_subdirectory(AVS)
9171
endif()

Cobalt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ add_library(${MODULE_NAME} SHARED
5454
CobaltJsonRpc.cpp
5555
Module.cpp)
5656

57+
set_target_properties(${MODULE_NAME} PROPERTIES
58+
CXX_STANDARD ${CXX_STD}
59+
CXX_STANDARD_REQUIRED YES)
60+
5761
add_library(${PLUGIN_COBALT_IMPLEMENTATION} SHARED
5862
Module.cpp
5963
CobaltImplementation.cpp)

Compositor/lib/Mesa/renderer/test/simpleworker/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ find_package(${NAMESPACE}Definitions REQUIRED)
2424
add_library(CompositorSimpleWorker STATIC
2525
SimpleWorker.cpp)
2626

27+
set_target_properties(CompositorSimpleWorker PROPERTIES
28+
CXX_STANDARD ${CXX_STD}
29+
CXX_STANDARD_REQUIRED YES)
30+
2731
target_include_directories(CompositorSimpleWorker PUBLIC
2832
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
2933
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}>)

DIALServer/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ add_library(${MODULE_NAME} SHARED
6666
DIALServerJsonRpc.cpp
6767
Module.cpp)
6868

69+
set_target_properties(${MODULE_NAME} PROPERTIES
70+
CXX_STANDARD ${CXX_STD}
71+
CXX_STANDARD_REQUIRED YES)
72+
6973
if(PLUGIN_DIALSERVER_ENABLE_YOUTUBE AND "${PLUGIN_DIALSERVER_YOUTUBE_MODE}" STREQUAL "active")
7074
target_sources(${MODULE_NAME}
7175
PRIVATE

0 commit comments

Comments
 (0)