2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-26 11:49:25 +01:00
xash3d-fwgs/ref/gl/wscript

85 lines
2.0 KiB
Plaintext
Raw Normal View History

#! /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]')
# 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.GL_STATIC = conf.options.GL_STATIC
if conf.env.GL_STATIC:
conf.check(lib='GL')
conf.define('REF_DLL', 1)
2019-05-02 17:07:03 +02:00
if conf.env.DEST_OS2 == 'android':
conf.check_cc(lib='log')
def build(bld):
2023-02-13 20:53:17 +01:00
libs = [ 'engine_includes' ]
# on PSVita do not link any libraries that are already in the main executable, but add the includes target
if bld.env.DEST_OS == 'psvita':
libs += [ 'sdk_includes', 'vgl_shim' ]
2023-02-13 20:53:17 +01:00
else:
libs += [ 'public', 'M' ]
2023-10-12 02:40:15 +02:00
source = bld.path.ant_glob(['*.c', 'gl2_shim/*.c'])
includes = '.'
targets = {
'ref_gl': {
'enable': bld.env.GL,
'libs': ['GL'] if bld.env.GL_STATIC else [],
'defines': ['XASH_GL_STATIC'] if bld.env.GL_STATIC else [],
},
'ref_gles1': {
'enable': bld.env.NANOGL,
2022-11-16 23:08:11 +01:00
'libs': ['DL', 'nanogl', 'LOG'],
'defines': ['XASH_NANOGL'],
},
'ref_gles2': {
'enable': bld.env.GLWES,
2022-11-16 23:08:11 +01:00
'libs': ['DL', 'gl-wes-v2', 'LOG'],
'defines': ['XASH_WES'],
},
'ref_gl4es': {
'enable': bld.env.GL4ES,
'libs': ['DL', 'gl4es', 'LOG'],
'defines': ['XASH_GL_STATIC', 'XASH_GL4ES'],
},
'ref_gles3compat': {
'enable': bld.env.GLES3COMPAT,
'libs': ['DL', 'gl4es', 'LOG'],
'defines': ['XASH_GLES3COMPAT'],
},
}
for k,v in targets.items():
if not v['enable']:
continue
bld.shlib(source = source,
target = k,
2020-02-25 06:58:36 +01:00
features = 'c',
includes = includes,
use = libs + v['libs'],
defines = v['defines'],
2020-02-25 06:58:36 +01:00
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM)