|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
# mittorn, 2018
|
|
|
|
|
|
|
|
from waflib import Logs
|
|
|
|
import os
|
|
|
|
|
|
|
|
top = '.'
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
grp = opt.add_option_group('ref_gl options')
|
|
|
|
|
|
|
|
grp.add_option('--enable-static-gl', action='store_true', dest='GL_STATIC', default=False,
|
|
|
|
help = 'enable direct linking to opengl [default: %default]')
|
|
|
|
|
|
|
|
grp.add_option('--enable-gles1', action='store_true', dest='NANOGL', default=False,
|
|
|
|
help = 'enable gles1 renderer [default: %default]')
|
|
|
|
|
|
|
|
grp.add_option('--enable-gles2', action='store_true', dest='GLWES', default=False,
|
|
|
|
help = 'enable gles2 renderer [default: %default]')
|
|
|
|
|
|
|
|
grp.add_option('--disable-gl', action='store_false', dest='GL', default=True,
|
|
|
|
help = 'disable opengl [default: %default]')
|
|
|
|
|
|
|
|
# stub
|
|
|
|
return
|
|
|
|
|
|
|
|
def configure(conf):
|
|
|
|
# check for dedicated server build
|
|
|
|
if conf.options.DEDICATED:
|
|
|
|
return
|
|
|
|
|
|
|
|
conf.define_cond('SUPPORT_BSP2_FORMAT', conf.options.SUPPORT_BSP2_FORMAT)
|
|
|
|
|
|
|
|
conf.env.NANOGL = conf.options.NANOGL
|
|
|
|
conf.env.GLWES = conf.options.GLWES
|
|
|
|
conf.env.GL = conf.options.GL
|
|
|
|
|
|
|
|
if conf.env.NANOGL:
|
|
|
|
conf.add_subproject('nanogl')
|
|
|
|
if conf.env.GLWES:
|
|
|
|
conf.add_subproject('gl-wes-v2')
|
|
|
|
|
|
|
|
conf.env.GL_STATIC = conf.options.GL_STATIC
|
|
|
|
if conf.env.GL_STATIC:
|
|
|
|
conf.check( lib='GL' )
|
|
|
|
|
|
|
|
conf.define('REF_DLL', 1)
|
|
|
|
if conf.env.DEST_OS2 == 'android':
|
|
|
|
conf.check_cc(lib='log')
|
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
libs = [ 'public', 'M' ]
|
|
|
|
|
|
|
|
source = bld.path.ant_glob(['*.c'])
|
|
|
|
|
|
|
|
includes = ['.',
|
|
|
|
'../engine',
|
|
|
|
'../engine/common',
|
|
|
|
'../engine/server',
|
|
|
|
'../engine/client',
|
|
|
|
'../public',
|
|
|
|
'../common',
|
|
|
|
'../pm_shared' ]
|
|
|
|
|
|
|
|
if bld.env.GL:
|
|
|
|
bld.shlib(
|
|
|
|
source = source,
|
|
|
|
target = 'ref_gl',
|
|
|
|
features = 'c',
|
|
|
|
includes = includes,
|
|
|
|
use = libs + ['GL'] if bld.env.GL_STATIC else [],
|
|
|
|
defines = ['XASH_GL_STATIC'] if bld.env.GL_STATIC else [],
|
|
|
|
install_path = bld.env.LIBDIR,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM
|
|
|
|
)
|
|
|
|
|
|
|
|
if bld.env.NANOGL:
|
|
|
|
bld.add_subproject('nanogl')
|
|
|
|
bld.shlib(
|
|
|
|
source = source,
|
|
|
|
target = 'ref_gles1',
|
|
|
|
features = 'c',
|
|
|
|
includes = includes,
|
|
|
|
use = libs + ['DL', 'nanogl'],
|
|
|
|
defines = ['XASH_NANOGL'],
|
|
|
|
install_path = bld.env.LIBDIR,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
|
|
|
|
|
|
|
if bld.env.GLWES:
|
|
|
|
bld.add_subproject('gl-wes-v2')
|
|
|
|
bld.shlib(
|
|
|
|
source = source,
|
|
|
|
target = 'ref_gles2',
|
|
|
|
features = 'c',
|
|
|
|
includes = includes,
|
|
|
|
use = libs + ['DL', 'gl-wes-v2'],
|
|
|
|
defines = ['XASH_WES'],
|
|
|
|
install_path = bld.env.LIBDIR,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|