cmake: Blacklist more compiler warning flags

pull/6256/head
Daniel Mensinger 5 years ago committed by Nirbheek Chauhan
parent af27af78bb
commit d0ca05498f
  1. 3
      mesonbuild/cmake/interpreter.py
  2. 10
      test cases/cmake/13 system includes/main.cpp
  3. 14
      test cases/cmake/13 system includes/meson.build
  4. 15
      test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt
  5. 12
      test cases/cmake/13 system includes/subprojects/cmMod/cmMod.cpp
  6. 13
      test cases/cmake/13 system includes/subprojects/cmMod/cmMod.hpp
  7. 14
      test cases/cmake/13 system includes/subprojects/cmMod/sysInc/triggerWarn.hpp

@ -82,7 +82,8 @@ target_type_requires_trace = ['INTERFACE_LIBRARY']
skip_targets = ['UTILITY']
blacklist_compiler_flags = [
'/W1', '/W2', '/W3', '/W4', '/Wall',
'-Wall', '-Wextra', '-Weverything', '-Werror', '-Wpedantic', '-pedantic', '-w',
'/W1', '/W2', '/W3', '/W4', '/Wall', '/WX', '/w',
'/O1', '/O2', '/Ob', '/Od', '/Og', '/Oi', '/Os', '/Ot', '/Ox', '/Oy', '/Ob0',
'/RTC1', '/RTCc', '/RTCs', '/RTCu',
'/Z7', '/Zi', '/ZI',

@ -0,0 +1,10 @@
#include <iostream>
#include <cmMod.hpp>
using namespace std;
int main() {
cmModClass obj("Hello");
cout << obj.getStr() << endl;
return 0;
}

@ -0,0 +1,14 @@
project(
'meson_cmake_system_include_bug', ['c', 'cpp'],
default_options: [
'warning_level=3',
#'werror=true', # TODO implement system includes
],
)
cm = import('cmake')
sub_pro = cm.subproject('cmMod')
sub_dep = sub_pro.dependency('cmModLib')
exe1 = executable('main1', ['main.cpp'], dependencies: [sub_dep])
test('test1', exe1)

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.5)
project(cmMod)
set (CMAKE_CXX_STANDARD 14)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions("-DDO_NOTHING_JUST_A_FLAG=1")
add_library(cmModLib SHARED cmMod.cpp)
include(GenerateExportHeader)
generate_export_header(cmModLib)
target_compile_options(cmModLib PRIVATE "-Wall" "-Werror")
target_include_directories(cmModLib SYSTEM PRIVATE "sysInc")

@ -0,0 +1,12 @@
#include "cmMod.hpp"
#include "triggerWarn.hpp"
using namespace std;
cmModClass::cmModClass(string foo) {
str = foo + " World " + to_string(bar(World));
}
string cmModClass::getStr() const {
return str;
}

@ -0,0 +1,13 @@
#pragma once
#include <string>
#include "cmmodlib_export.h"
class CMMODLIB_EXPORT cmModClass {
private:
std::string str;
public:
cmModClass(std::string foo);
std::string getStr() const;
};

@ -0,0 +1,14 @@
#pragma once
enum Foo {
Hello,
World
};
inline int bar( Foo foo ) {
switch(foo) {
case Hello: return 0;
// Warn because of missung case for World
}
return 1;
}
Loading…
Cancel
Save