From 968994bba54441e439d856a756037c612cf93972 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 11 Apr 2019 01:26:33 +0300 Subject: [PATCH] ref_gl: add an option to disable ref_gl building --- ref_gl/wscript | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ref_gl/wscript b/ref_gl/wscript index 1a129d25..d4632278 100644 --- a/ref_gl/wscript +++ b/ref_gl/wscript @@ -18,6 +18,9 @@ def options(opt): grp.add_option('--enable-gles2', action='store_true', dest='GLWES', help = 'enable gles2 renderer by linking gl-wes-v2 statically(put source to ref_gl directory)') + + grp.add_option('--disable-gl', action='store_false', dest='GL', default=True, + help = 'disable building OpenGL renderer(default: False)') # stub return @@ -66,16 +69,17 @@ def build(bld): if glstatic: return ['XASH_GL_STATIC'] else: return [] - bld.shlib( - source = source, - target = 'ref_gl', - features = 'c', - includes = includes, - use = libs + link_gl(bld.env.GL_STATIC), - defines = static_gl(bld.env.GL_STATIC), - install_path = bld.env.LIBDIR, - subsystem = bld.env.MSVC_SUBSYSTEM - ) + if bld.env.GL: + bld.shlib( + source = source, + target = 'ref_gl', + features = 'c', + includes = includes, + use = libs + link_gl(bld.env.GL_STATIC), + defines = static_gl(bld.env.GL_STATIC), + install_path = bld.env.LIBDIR, + subsystem = bld.env.MSVC_SUBSYSTEM + ) if bld.env.NANOGL: bld.add_subproject('nanogl')