Skip to content

Commit

Permalink
Add Waf script (example 1).
Browse files Browse the repository at this point in the history
  • Loading branch information
SviatoslavRazmyslov committed Sep 14, 2018
1 parent 7ba137d commit 3d0dfe6
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
15 changes: 15 additions & 0 deletions example-1/a.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#ifdef _MSC_VER
# define testshlib_EXPORT __declspec(dllexport)
#else
# define testshlib_EXPORT
#endif

extern testshlib_EXPORT void foo();

static const int truc=5;

void foo() { }

4 changes: 4 additions & 0 deletions example-1/b.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

int u = 64;
6 changes: 6 additions & 0 deletions example-1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

int main() {
return 0;
}
11 changes: 11 additions & 0 deletions example-1/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

#include <iostream>

extern void foo();

int main() {
foo();
return 0;
}
33 changes: 33 additions & 0 deletions example-1/wscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)

VERSION='0.0.1'
APPNAME='cxx_test'

top = '.'
out = 'build'

def options(opt):
opt.load('compiler_cxx')

def configure(conf):
conf.load('compiler_cxx')
conf.check(header_name='stdio.h', features='cxx cxxprogram', mandatory=False)
conf.load('clang_compilation_database')

def build(bld):
bld.shlib(source='a.cpp', target='mylib', vnum='9.8.7')
bld.shlib(source='a.cpp', target='mylib2', vnum='9.8.7', cnum='9.8')
bld.shlib(source='a.cpp', target='mylib3')
bld.program(source='main.cpp', target='app', use='mylib')
bld.stlib(target='foo', source='b.cpp')

bld.program(features='cxx cxxprogram', source='main.c', target='app2')

if bld.cmd != 'clean':
from waflib import Logs
bld.logger = Logs.make_logger('test.log', 'build')
bld.check(header_name='sadlib.h', features='cxx cxxprogram', mandatory=False)
bld.logger = None

0 comments on commit 3d0dfe6

Please sign in to comment.