Skip to content

Commit ad2a2b3

Browse files
committed
meson: add libtess2 subproject wrap file and a meson override
1 parent bbb64cf commit ad2a2b3

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

subprojects/libtess2.wrap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[wrap-git]
2+
url = https://github.com/memononen/libtess2.git
3+
revision = v1.0.2
4+
depth = 1
5+
6+
# Loads "overrides" (aka move files from that folder to the cloned one) from packagefiles/libtess2
7+
# this is to "meson-ize" the project
8+
# There are many meson-ized projects in here https://mesonbuild.com/Wrapdb-projects.html
9+
# more information on how to use them here https://mesonbuild.com/Wrap-dependency-system-manual.html
10+
patch_directory = libtess2
11+
12+
[provide]
13+
dependency_names = libtess2_dep
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
project('libtess2', 'c',
2+
version : '0.12.0',
3+
default_options : [
4+
'buildtype=release',
5+
'optimization=3',
6+
'default_library=static',
7+
'prefer_static=true',
8+
'b_ndebug=if-release',
9+
'c_args=-pipe',
10+
'cpp_args=-pipe',
11+
]
12+
)
13+
14+
inc = include_directories(
15+
'Include',
16+
'Source'
17+
)
18+
19+
install_headers('Include/tesselator.h')
20+
21+
sources = files(
22+
'Source/bucketalloc.c',
23+
'Source/dict.c',
24+
'Source/geom.c',
25+
'Source/mesh.c',
26+
'Source/priorityq.c',
27+
'Source/sweep.c',
28+
'Source/tess.c',
29+
)
30+
31+
lib = library('tess2',
32+
sources,
33+
include_directories: inc,
34+
install: true)
35+
36+
libtess2_dep = declare_dependency(include_directories: 'Include', link_with: lib)
37+
38+
# This is to make meson projects using this one as subproject find the dependency
39+
# automagically when doing "dependency('libtess2')"
40+
meson.override_dependency('libtess2', libtess2_dep)
41+
42+
pkg = import('pkgconfig')
43+
pkg.generate(lib)

0 commit comments

Comments
 (0)