xash3d-fwgs/ref_vk/wscript

66 lines
1.5 KiB
Python

#! /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_vk options')
def configure(conf):
# check for dedicated server build
if conf.options.DEDICATED:
return
conf.load('glslc')
conf.define('REF_DLL', 1)
if conf.env.DEST_OS == 'win32':
conf.start_msg('Vulkan SDK available?')
if not 'VULKAN_SDK' in conf.environ:
Logs.warn('VULKAN_SDK environment variable is not available, ref_vk will not be built')
conf.end_msg('no')
conf.env.VULKAN_SDK = conf.environ['VULKAN_SDK']
conf.end_msg('found at ' + conf.env.VULKAN_SDK)
def build(bld):
libs = [ 'public', 'M' ]
source = bld.path.ant_glob(['*.c'])
glsl_source = bld.path.ant_glob(['shaders/*.vert', 'shaders/*.frag', 'shaders/*.comp'])
includes = ['.',
'../engine',
'../engine/common',
'../engine/server',
'../engine/client',
'../public',
'../common',
'../pm_shared' ]
if bld.env.DEST_OS == 'win32':
includes.append(bld.env.VULKAN_SDK + '\\Include')
bld.shlib(
source = source,
target = 'ref_vk',
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
)
bld(
source = glsl_source,
features = 'glsl',
# includes = 'shaders/', # write your includes here
# defines = 'TEST', # write your C preprocessor defines here
install_path = bld.env.LIBDIR + '/valve' # TEMPORARY!!!!
)