parent
af27af78bb
commit
d0ca05498f
7 changed files with 80 additions and 1 deletions
@ -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…
Reference in new issue