Add Meson build system
This should be on par with the autoconf build. Like autoconf it defauilts to generating both a shared and static library. I have intentionally not used the pkg-config template, and used Meson's pkg-config generator instad. This provides dependency and include tracking that would otherwise have to be done manually.
This commit is contained in:
38
meson.build
Normal file
38
meson.build
Normal file
@@ -0,0 +1,38 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright © 2021 Intel Corporation
|
||||
|
||||
project(
|
||||
'glu',
|
||||
['c', 'cpp'],
|
||||
version : '9.0.1',
|
||||
meson_version : '>= 0.52.0',
|
||||
license : 'SGI-B-1.1 AND SGI-B-2.0 AND MIT AND GPL-2.0-or-later',
|
||||
default_options : ['default_library=both', 'b_ndebug=if-release']
|
||||
)
|
||||
|
||||
if get_option('debug')
|
||||
add_project_arguments('-DDEBUG', language : ['c', 'cpp'])
|
||||
endif
|
||||
|
||||
gl_provider = get_option('gl_provider')
|
||||
if gl_provider == 'glvnd'
|
||||
gl_provider = 'opengl'
|
||||
endif
|
||||
dep_gl = dependency(gl_provider)
|
||||
|
||||
inc_include = include_directories('include')
|
||||
|
||||
subdir('src')
|
||||
|
||||
install_headers(
|
||||
'include/GL/glu_mangle.h',
|
||||
'include/GL/glu.h',
|
||||
subdir : 'GL',
|
||||
)
|
||||
|
||||
pkgconf = import('pkgconfig')
|
||||
pkgconf.generate(
|
||||
libglu,
|
||||
name : 'glu',
|
||||
description : 'Mesa OpenGL Utility Library',
|
||||
)
|
10
meson_options.txt
Normal file
10
meson_options.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright © 2021 Intel Corporation
|
||||
|
||||
option(
|
||||
'gl_provider',
|
||||
type : 'combo',
|
||||
choices : ['glvnd', 'gl', 'osmesa'],
|
||||
value : 'glvnd',
|
||||
description : 'Which OpenGL to link with'
|
||||
)
|
116
src/meson.build
Normal file
116
src/meson.build
Normal file
@@ -0,0 +1,116 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright © 2021 Intel Corporation
|
||||
|
||||
libglu = library(
|
||||
'GLU',
|
||||
[
|
||||
'libutil/error.c',
|
||||
'libutil/glue.c',
|
||||
'libutil/mipmap.c',
|
||||
'libutil/project.c',
|
||||
'libutil/quad.c',
|
||||
'libutil/registry.c',
|
||||
'libtess/dict.c',
|
||||
'libtess/geom.c',
|
||||
'libtess/memalloc.c',
|
||||
'libtess/mesh.c',
|
||||
'libtess/normal.c',
|
||||
'libtess/priorityq.c',
|
||||
'libtess/render.c',
|
||||
'libtess/sweep.c',
|
||||
'libtess/tess.c',
|
||||
'libtess/tessmono.c',
|
||||
'libnurbs/interface/bezierEval.cc',
|
||||
'libnurbs/interface/bezierPatch.cc',
|
||||
'libnurbs/interface/bezierPatchMesh.cc',
|
||||
'libnurbs/interface/glcurveval.cc',
|
||||
'libnurbs/interface/glinterface.cc',
|
||||
'libnurbs/interface/glrenderer.cc',
|
||||
'libnurbs/interface/glsurfeval.cc',
|
||||
'libnurbs/interface/incurveeval.cc',
|
||||
'libnurbs/interface/insurfeval.cc',
|
||||
'libnurbs/internals/arc.cc',
|
||||
'libnurbs/internals/arcsorter.cc',
|
||||
'libnurbs/internals/arctess.cc',
|
||||
'libnurbs/internals/backend.cc',
|
||||
'libnurbs/internals/basiccrveval.cc',
|
||||
'libnurbs/internals/basicsurfeval.cc',
|
||||
'libnurbs/internals/bin.cc',
|
||||
'libnurbs/internals/bufpool.cc',
|
||||
'libnurbs/internals/cachingeval.cc',
|
||||
'libnurbs/internals/ccw.cc',
|
||||
'libnurbs/internals/coveandtiler.cc',
|
||||
'libnurbs/internals/curve.cc',
|
||||
'libnurbs/internals/curvelist.cc',
|
||||
'libnurbs/internals/curvesub.cc',
|
||||
'libnurbs/internals/dataTransform.cc',
|
||||
'libnurbs/internals/displaylist.cc',
|
||||
'libnurbs/internals/flist.cc',
|
||||
'libnurbs/internals/flistsorter.cc',
|
||||
'libnurbs/internals/hull.cc',
|
||||
'libnurbs/internals/intersect.cc',
|
||||
'libnurbs/internals/knotvector.cc',
|
||||
'libnurbs/internals/mapdesc.cc',
|
||||
'libnurbs/internals/mapdescv.cc',
|
||||
'libnurbs/internals/maplist.cc',
|
||||
'libnurbs/internals/mesher.cc',
|
||||
'libnurbs/internals/monoTriangulationBackend.cc',
|
||||
'libnurbs/internals/monotonizer.cc',
|
||||
'libnurbs/internals/mycode.cc',
|
||||
'libnurbs/internals/nurbsinterfac.cc',
|
||||
'libnurbs/internals/nurbstess.cc',
|
||||
'libnurbs/internals/patch.cc',
|
||||
'libnurbs/internals/patchlist.cc',
|
||||
'libnurbs/internals/quilt.cc',
|
||||
'libnurbs/internals/reader.cc',
|
||||
'libnurbs/internals/renderhints.cc',
|
||||
'libnurbs/internals/slicer.cc',
|
||||
'libnurbs/internals/sorter.cc',
|
||||
'libnurbs/internals/splitarcs.cc',
|
||||
'libnurbs/internals/subdivider.cc',
|
||||
'libnurbs/internals/tobezier.cc',
|
||||
'libnurbs/internals/trimline.cc',
|
||||
'libnurbs/internals/trimregion.cc',
|
||||
'libnurbs/internals/trimvertpool.cc',
|
||||
'libnurbs/internals/uarray.cc',
|
||||
'libnurbs/internals/varray.cc',
|
||||
'libnurbs/nurbtess/directedLine.cc',
|
||||
'libnurbs/nurbtess/gridWrap.cc',
|
||||
'libnurbs/nurbtess/monoChain.cc',
|
||||
'libnurbs/nurbtess/monoPolyPart.cc',
|
||||
'libnurbs/nurbtess/monoTriangulation.cc',
|
||||
'libnurbs/nurbtess/partitionX.cc',
|
||||
'libnurbs/nurbtess/partitionY.cc',
|
||||
'libnurbs/nurbtess/polyDBG.cc',
|
||||
'libnurbs/nurbtess/polyUtil.cc',
|
||||
'libnurbs/nurbtess/primitiveStream.cc',
|
||||
'libnurbs/nurbtess/quicksort.cc',
|
||||
'libnurbs/nurbtess/rectBlock.cc',
|
||||
'libnurbs/nurbtess/sampleComp.cc',
|
||||
'libnurbs/nurbtess/sampleCompBot.cc',
|
||||
'libnurbs/nurbtess/sampleCompRight.cc',
|
||||
'libnurbs/nurbtess/sampleCompTop.cc',
|
||||
'libnurbs/nurbtess/sampleMonoPoly.cc',
|
||||
'libnurbs/nurbtess/sampledLine.cc',
|
||||
'libnurbs/nurbtess/searchTree.cc',
|
||||
],
|
||||
c_args : ['-DLIBRARYBUILD'],
|
||||
cpp_args : ['-DLIBRARYBUILD'],
|
||||
include_directories : [
|
||||
'include',
|
||||
'libnurbs/internals',
|
||||
'libnurbs/interface',
|
||||
'libnurbs/nurbtess',
|
||||
inc_include,
|
||||
],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
dependencies : [dep_gl],
|
||||
version : '1.3.1',
|
||||
install : true,
|
||||
)
|
||||
|
||||
# for subproject users
|
||||
dep_glu = declare_dependency(
|
||||
link_with : libglu,
|
||||
include_directories : inc_include,
|
||||
)
|
Reference in New Issue
Block a user