mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-16 06:00:33 +01:00
ref_gl: add options for linking-in nanogl and glwes(thus getting GLES1 and GLES2 renderers) and static gl
This commit is contained in:
parent
f4bcea6182
commit
77b23eec9f
@ -4,11 +4,21 @@
|
|||||||
|
|
||||||
from waflib import Logs
|
from waflib import Logs
|
||||||
import os
|
import os
|
||||||
from fwgslib import get_subproject_name
|
|
||||||
|
|
||||||
top = '.'
|
top = '.'
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
|
grp = opt.add_option_group('ref_gl options')
|
||||||
|
|
||||||
|
grp.add_option('--enable-static-gl', action='store_true', dest='GL_STATIC',
|
||||||
|
help = 'don\'t load opengl in runtime, instead link to libGL directly(default: False)')
|
||||||
|
|
||||||
|
grp.add_option('--enable-gles1', action='store_true', dest='NANOGL',
|
||||||
|
help = 'enable gles1 renderer by linking nanogl statically(put source to ref_gl directory)')
|
||||||
|
|
||||||
|
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)')
|
||||||
|
|
||||||
# stub
|
# stub
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -20,6 +30,17 @@ def configure(conf):
|
|||||||
if conf.options.SUPPORT_BSP2_FORMAT:
|
if conf.options.SUPPORT_BSP2_FORMAT:
|
||||||
conf.env.append_unique('DEFINES', 'SUPPORT_BSP2_FORMAT')
|
conf.env.append_unique('DEFINES', 'SUPPORT_BSP2_FORMAT')
|
||||||
|
|
||||||
|
conf.env.NANOGL = conf.options.NANOGL
|
||||||
|
conf.env.GLWES = conf.options.GLWES
|
||||||
|
|
||||||
|
if conf.env.NANOGL: conf.recurse('nanogl')
|
||||||
|
if conf.env.GLWES:
|
||||||
|
conf.recurse('gl-wes-v2')
|
||||||
|
|
||||||
|
conf.env.GL_STATIC = conf.options.GL_STATIC
|
||||||
|
if conf.env.GL_STATIC:
|
||||||
|
conf.check( lib='GL' )
|
||||||
|
|
||||||
conf.env.append_unique('DEFINES', 'REF_DLL')
|
conf.env.append_unique('DEFINES', 'REF_DLL')
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
@ -36,12 +57,45 @@ def build(bld):
|
|||||||
'../common',
|
'../common',
|
||||||
'../pm_shared' ]
|
'../pm_shared' ]
|
||||||
|
|
||||||
|
def link_gl( glstatic ):
|
||||||
|
if glstatic: return ['GL']
|
||||||
|
else: return []
|
||||||
|
|
||||||
|
def static_gl( glstatic ):
|
||||||
|
if glstatic: return ['XASH_GL_STATIC']
|
||||||
|
else: return []
|
||||||
|
|
||||||
bld.shlib(
|
bld.shlib(
|
||||||
source = source,
|
source = source,
|
||||||
target = 'ref_gl',
|
target = 'ref_gl',
|
||||||
features = 'c',
|
features = 'c',
|
||||||
includes = includes,
|
includes = includes,
|
||||||
use = libs,
|
use = libs + link_gl(bld.env.GL_STATIC),
|
||||||
|
defines = static_gl(bld.env.GL_STATIC),
|
||||||
install_path = bld.env.LIBDIR,
|
install_path = bld.env.LIBDIR,
|
||||||
subsystem = bld.env.MSVC_SUBSYSTEM
|
subsystem = bld.env.MSVC_SUBSYSTEM
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if bld.env.NANOGL:
|
||||||
|
bld.recurse('nanogl')
|
||||||
|
bld.shlib(
|
||||||
|
source = source,
|
||||||
|
target = 'ref_gles1',
|
||||||
|
features = 'c',
|
||||||
|
includes = includes,
|
||||||
|
use = libs + ['nanogl', 'DL' ],
|
||||||
|
defines = ['XASH_GLES', 'XASH_NANOGL'],
|
||||||
|
install_path = bld.env.LIBDIR,
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
||||||
|
|
||||||
|
if bld.env.GLWES:
|
||||||
|
bld.recurse('gl-wes-v2')
|
||||||
|
bld.shlib(
|
||||||
|
source = source,
|
||||||
|
target = 'ref_gles2',
|
||||||
|
features = 'c',
|
||||||
|
includes = includes,
|
||||||
|
use = libs + ['gl-wes-v2', 'DL'],
|
||||||
|
defines = ['XASH_GLES', 'XASH_WES'],
|
||||||
|
install_path = bld.env.LIBDIR,
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
||||||
|
Loading…
Reference in New Issue
Block a user