Skip to content

Commit

Permalink
[Warnings] Adding warnings to the local build (#277)
Browse files Browse the repository at this point in the history
* Fixing warnings and adding warnings to the local build

* Turns out the compile settings are inherited from Thunder, so no need to add them again

* Warnings from Thudner are no longer leaking, so lets add them to each module separately

* Using the option from WPEFramework package
  • Loading branch information
VeithMetro authored Aug 24, 2023
1 parent e3e3411 commit bdd147b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,30 @@ cmake_minimum_required(VERSION 3.12)

project(Interfaces)

find_package(WPEFramework)

set(INTERFACES_PATTERNS "I*.h" CACHE STRING "Patterns matching files for which stubs should be generated")
set(JSONRPC_PATTERNS "*.json" CACHE STRING "Patterns matching files for which json stubs should be generated")

if(ENABLE_STRICT_COMPILER_SETTINGS)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR "Compiling with Clang")
set(CMAKE_STRICT_COMPILER_SETTINGS "-Weverything -Wextra -Wpedantic -Werror")
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
elseif(${CMAKE_COMPILER_IS_GNUCXX})
message(STATUS "Compiling with GCC")
set(CMAKE_STRICT_COMPILER_SETTINGS "-Wall -Wextra -Wpedantic -Werror")
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(STATUS "Compiling with MS Visual Studio")
set(CMAKE_STRICT_COMPILER_SETTINGS "/W4")
else()
message(STATUS "Compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_STRICT_CXX_COMPILER_SETTINGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_STRICT_COMPILER_SETTINGS}")
endif()

if (BUILD_REFERENCE)
add_definitions (-DBUILD_REFERENCE=${BUILD_REFERENCE})
endif()
Expand Down
2 changes: 1 addition & 1 deletion definitions/Definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#include "ValuePoint.h"
#endif

MODULE_NAME_DECLARATION(BUILD_REFERENCE);
MODULE_NAME_DECLARATION(BUILD_REFERENCE)

namespace WPEFramework {

Expand Down
12 changes: 6 additions & 6 deletions definitions/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@

namespace WPEFramework {

ENUM_CONVERSION_HANDLER(Exchange::IComposition::ScreenResolution);
ENUM_CONVERSION_HANDLER(Exchange::IStream::streamtype);
ENUM_CONVERSION_HANDLER(Exchange::IStream::state);
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::basic);
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::specific);
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::dimension);
ENUM_CONVERSION_HANDLER(Exchange::IComposition::ScreenResolution)
ENUM_CONVERSION_HANDLER(Exchange::IStream::streamtype)
ENUM_CONVERSION_HANDLER(Exchange::IStream::state)
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::basic)
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::specific)
ENUM_CONVERSION_HANDLER(Exchange::IValuePoint::dimension)
}
2 changes: 1 addition & 1 deletion interfaces/json/ExternalMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ namespace WPEFramework {
}
}

ENUM_CONVERSION_HANDLER(Exchange::External::Metadata::protocol);
ENUM_CONVERSION_HANDLER(Exchange::External::Metadata::protocol)
}

0 comments on commit bdd147b

Please sign in to comment.