-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJamroot
234 lines (200 loc) · 7.4 KB
/
Jamroot
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright 2019 Felipe Magno de Almeida
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import project ;
import configure ;
import property-set ;
path-constant current-pwd : . ;
#path si : deps/sweep-interval ;
use-project sweep-interval : deps//sweep-interval ;
rule init-deps ( )
{
local using-conan = [ GLOB $(__file__:D) : conanbuildinfo.jam : downcase ] ;
local pkg-config-libraries =
vulkan
harfbuzz
freetype2
libinput
libudev
libuv
xkbcommon
libpng
libjpeg
libdrm
fontconfig
x11
;
if ! $(using-conan)
{
pkg-config-librariies += pugixml ;
}
for local lib in $(pkg-config-libraries)
{
local project = [ project.find $(lib) : $(current-pwd) ] ;
if ! $(project)
{
project $(lib) ;
alias $(lib) : : : : <cxxflags>"`pkg-config --cflags $(lib)`" <linkflags>"`pkg-config --libs $(lib)`" ;
exe has_$(lib) : [ obj has_$(lib)_obj : build/$(lib).cpp /$(lib)//$(lib) ] ;
explicit has_$(lib) ;
}
}
rule configure-vulkan ( properties * )
{
if ! [ configure.builds /vulkan//has_vulkan : $(properties) : "vulkan" ]
{
ECHO not found vulkan library. Install with apt-get install libvulkan-devel or something like this. ;
}
}
rule configure-harfbuzz ( properties * )
{
if ! [ configure.builds /harfbuzz//has_harfbuzz : $(properties) : "harfbuzz" ]
{
ECHO not found harfbuzz library. Install with apt-get install libharfbuzz-devel or something like this. ;
}
}
rule configure-freetype2 ( properties * )
{
if ! [ configure.builds /freetype2//has_freetype2 : $(properties) : "freetype2" ]
{
ECHO not found freetype2 library. Install with apt-get install libfreetype2-devel or something like this. ;
}
}
rule configure-libinput ( properties * )
{
if ! [ configure.builds /libinput//has_libinput : $(properties) : "libinput" ]
{
ECHO not found libinput library. Install with apt-get install libinput-devel or something like this. ;
}
}
rule configure-libudev ( properties * )
{
if ! [ configure.builds /libudev//has_libudev : $(properties) : "libudev" ]
{
ECHO not found libudev library. Install with apt-get install libudev-devel or something like this. ;
}
}
rule configure-libuv ( properties * )
{
if ! [ configure.builds /libuv//has_libuv : $(properties) : "libuv" ]
{
ECHO not found libuv library. Install with apt-get install libuv-devel or something like this. ;
}
}
rule configure-xkbcommon ( properties * )
{
if ! [ configure.builds /xkbcommon//has_xkbcommon : $(properties) : "xkbcommon" ]
{
ECHO not found xkbcommon library. Install with apt-get install libxkbcommon-devel or something like this. ;
}
}
rule configure-pugixml ( properties * )
{
if ! [ configure.builds /pugixml//has_pugixml : $(properties) : "xkbcommon" ]
{
ECHO not found pugixml library. Install with apt-get install libpugixml-devel or something like this. ;
}
}
rule configure-libpng ( properties * )
{
if ! [ configure.builds /libpng//has_libpng : $(properties) : "libpng" ]
{
ECHO not found libpng library. Install with apt-get install libpng-devel or something like this. ;
}
}
rule configure-libjpeg ( properties * )
{
if ! [ configure.builds /libjpeg//has_libjpeg : $(properties) : "libjpeg" ]
{
ECHO not found libjpeg library. Install with apt-get install libjpeg-devel or something like this. ;
}
}
rule configure-libdrm ( properties * )
{
if ! [ configure.builds /libdrm//has_libdrm : $(properties) : "libdrm" ]
{
ECHO not found libdrm library. Install with apt-get install libdrm-devel or something like this. ;
}
}
rule configure-fontconfig ( properties * )
{
if ! [ configure.builds /fontconfig//has_fontconfig : $(properties) : "fontconfig" ]
{
ECHO not found fontconfig library. Install with apt-get install fontconfig-devel or something like this. ;
}
}
rule configure-x11 ( properties * )
{
if ! [ configure.builds /x11//has_x11 : $(properties) : "x11" ]
{
ECHO not found X11 library. Install with apt-get install x11-devel or something like this. ;
}
}
for local lib in $(pkg-config-libraries)
{
local project = [ project.find $(lib) : $(current-pwd) ] ;
if ! $(project)
{
alias build_options_$(lib) : : : : <conditional>@configure-$(lib) ;
}
}
if ! $(using-conan)
{
local pc-ts = [ project.find portable_concurrency : $(current-pwd) ] ;
if ! $(pc-ts)
{
local pc-ts-prefix-dir = [ MATCH ^--pc-ts-dir=(.*)$ : [ modules.peek : ARGV ] ] ;
if ! $(pc-ts-prefix-dir)
{
ECHO Not found pc-ts library. Please download and install it. Then pass --pc-ts-dir=path-to-installed-pc-ts to build command ;
}
else
{
project portable_concurrency ;
lib portable_concurrency : : <name>portable_concurrency <search>$(pc-ts-prefix-dir)/lib <search>$(pc-ts-prefix-dir)/lib64
: : <include>$(pc-ts-prefix-dir)/include ;
}
}
}
}
init-deps ;
using glslang ;
import testing : run ;
import string ;
project ftk ;
local shader_sources =
res/shader/vulkan/fill_indirect_draw_buffer.frag
res/shader/vulkan/fill_indirect_draw_buffer.vert
res/shader/vulkan/indirect_draw_component.frag
res/shader/vulkan/indirect_draw_component.vert
;
local shader_targets = ;
for local file in $(shader_sources)
{
local chars = [ string.chars $(file:S) ] ;
local suffix = $(chars[2-]:J="") ;
local target = $(file:B)_$(suffix) ;
local requirements ;
if $(suffix) = vert
{
requirements += <define>VERTEX_SHADER ;
}
shader_targets += $(target) ;
glslang $(target) : $(file) : <include>res/shader/vulkan $(requirements) ;
}
alias shaders : $(shader_targets) ;
stage compiled-res : shaders : <location>compiled-res/shader/vulkan ;
alias ftk : /portable_concurrency//portable_concurrency compiled-res /sweep-interval//sweep-interval
: : : <include>include <cxxflags>-std=c++17 <linkflags>-lstdc++fs
;
path-constant res-path : compiled-res ;
path-constant test-res-path : tests/res ;
alias testsuite :
[ run tests/image_box1.cpp ftk /boost//headers /libuv//libuv /vulkan//vulkan /x11//x11 /harfbuzz//harfbuzz /freetype2//freetype2 /libpng//libpng /libjpeg//libjpeg : $(res-path) $(test-res-path) : : <dependency>compiled-res ]
[ run tests/move_image_box1.cpp ftk /boost//headers /libuv//libuv /vulkan//vulkan /x11//x11 /harfbuzz//harfbuzz /freetype2//freetype2 /libpng//libpng /libjpeg//libjpeg : $(res-path) $(test-res-path) : : <dependency>compiled-res ]
[ run tests/rectangle_box1.cpp ftk /boost//headers /libuv//libuv /vulkan//vulkan /x11//x11 /harfbuzz//harfbuzz /freetype2//freetype2 : $(res-path) : : <dependency>compiled-res ]
[ run tests/arc_box1.cpp ftk /boost//headers /libuv//libuv /vulkan//vulkan /x11//x11 /harfbuzz//harfbuzz /freetype2//freetype2 /libpng//libpng /libjpeg//libjpeg : $(res-path) $(test-res-path) : : <dependency>compiled-res ]
[ run tests/font_box1.cpp ftk /boost//headers /fontconfig//fontconfig /libuv//libuv /vulkan//vulkan /x11//x11 /harfbuzz//harfbuzz /freetype2//freetype2 /libpng//libpng /libjpeg//libjpeg : $(res-path) $(test-res-path) : : <dependency>compiled-res ]
[ run tests/region_test1.cpp ftk : $(res-path) $(test-res-path) : : <dependency>compiled-res ]
;