summaryrefslogtreecommitdiff
path: root/Jamroot.jam
blob: 9ba8966f01131e7730ecfc73646f9d81a1aa000a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using gcc : 11.2.0 ;
using pkg-config ;
import pkg-config ;
import type : register ;
import type : type ;
import generators : register-standard ;
import testing ;
import lex ;
import sequence ;

pkg-config.import sdl2 ;
pkg-config.import glew ;
lib pthread ;

variant coverage : debug ;
project : requirements
	<cxxstd>20
	<variant>debug:<warnings>pedantic
	<variant>debug:<warnings-as-errors>on
	<variant>release:<lto>on
	<variant>coverage:<coverage>on
	<toolset>tidy:<exclude>gfx/models/obj.cpp
	<toolset>tidy:<exclude>lib/jsonParse.cpp
	<toolset>tidy:<checkxx>boost-*
	<toolset>tidy:<checkxx>bugprone-*
	<toolset>tidy:<checkxx>clang-*
	<toolset>tidy:<checkxx>misc-*
	<toolset>tidy:<xcheckxx>misc-non-private-member-variables-in-classes
	<toolset>tidy:<checkxx>modernize-*
	<toolset>tidy:<xcheckxx>modernize-use-trailing-return-type
	<toolset>tidy:<checkxx>hicpp-*
	<toolset>tidy:<xcheckxx>hicpp-signed-bitwise
	<toolset>tidy:<xcheckxx>hicpp-named-parameter
	<toolset>tidy:<xcheckxx>hicpp-no-array-decay
	<toolset>tidy:<checkxx>performance-*
	<toolset>tidy:<comments>no
	<toolset>tidy:<mapping>iwyu.json
	<toolset>tidy:<define>TIDY
	;

type.register GL_VERTEX_SHADER : vs ;
type.register GL_FRAGMENT_SHADER : fs ;

generators.register-standard embed.glsl : GL_VERTEX_SHADER : CPP(vs-%) H(vs-%) ;
generators.register-standard embed.glsl : GL_FRAGMENT_SHADER : CPP(fs-%) H(fs-%) ;

actions embed.glsl
{
	m4 -DNAME=$(2:B) -DTYPE=$(2:S) > $(1[2]) lib/embed-glsl.h.m4
	m4 -DSOURCE=$(2) -DNAME=$(2:B) -DTYPE=$(2:S) -DGLTYPE=$(OPTIONS) > $(1[1]) lib/embed-glsl.cpp.m4
}
rule embed.glsl ( targets * : sources * : properties * )
{
	DEPENDS $(targets) : lib/embed-glsl.h.m4 lib/embed-glsl.cpp.m4 ;
	OPTIONS on $(targets) = [ type.type $(sources) ] ;
}
IMPORT $(__name__) : embed.glsl : : embed.glsl ;

exe iliketrains :
	application/main.cpp
	:
	<library>ilt
	;

explicit main ;
run application/main.cpp
	: -- :
	[ sequence.insertion-sort [ glob res/* ] ]
	:
	<library>ilt
	;

lib ilt :
	[ glob-tree *.cpp *.vs *.fs : application bin test ]
	[ lib generated : [ glob-tree *.ll *.c ] :
		<include>.
		<include>lib
		<variant>release
		<link>static
		<cflags>-fPIC
	]
	:
	<include>.
	<include>lib
	<library>sdl2
	<library>glew
	<library>pthread
	: :
	<include>.
	<include>lib
	;

build-project test ;