summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-23 14:49:51 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-23 21:04:35 -0700
commitc5d21daae195c1868981bacd7c334fd315471f0c (patch)
tree9208b9f3fd5209b54b361b5750e043ffb0c90343 /meson.build
parent9552bcc128c599e068d41cc16a9cbabd44cf627b (diff)
downloadglu-c5d21daae195c1868981bacd7c334fd315471f0c.tar.gz
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.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build38
1 files changed, 38 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c0de7b6
--- /dev/null
+++ b/meson.build
@@ -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',
+)