mesa/src/util/SConscript
Eric Anholt 882ca6dfb0 util: Move gallium's PIPE_FORMAT utils to /util/format/
To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to
move their helpers out of gallium.  Since u_format used
util_copy_rect(), I moved that in there, too.

I've put it in a separate directory in util/ because it's a big chunk
of related code, and it's not clear to me whether we might want it as
a separate library from libmesa_util at some point.

Closes: #1905
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-11-14 10:47:20 -08:00

85 lines
1.7 KiB
Python

import common
Import('*')
from sys import executable as python_cmd
env = env.Clone()
env.MSVC2013Compat()
env.Prepend(CPPPATH = [
'#include',
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
'#src',
'#src/mapi',
'#src/mesa',
'#src/gallium/include',
'#src/gallium/auxiliary',
'#src/util',
'#src/util/format',
])
env.CodeGenerate(
target = 'format_srgb.c',
script = 'format_srgb.py',
source = [],
command = python_cmd + ' $SCRIPT > $TARGET'
)
env.CodeGenerate(
target = 'format/u_format_table.c',
script = 'format/u_format_table.py',
source = ['format/u_format.csv'],
command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
)
env.Depends('format/u_format_table.c', [
'format/u_format_parse.py',
'format/u_format_pack.py',
])
# parse Makefile.sources
source_lists = env.ParseSourceList('Makefile.sources')
mesautil_sources = (
source_lists['MESA_UTIL_FILES'] +
source_lists['MESA_UTIL_GENERATED_FILES']
)
mesautilenv = env.Clone()
if env['dri']:
mesautil_sources += source_lists['XMLCONFIG_FILES']
mesautilenv.AppendUnique(LIBS = [
'expat',
])
mesautil = mesautilenv.ConvenienceLibrary(
target = 'mesautil',
source = mesautil_sources,
)
env.Alias('mesautil', mesautil)
Export('mesautil')
u_atomic_test = env.Program(
target = 'u_atomic_test',
source = ['u_atomic_test.c'],
)
env.UnitTest("u_atomic_test", u_atomic_test)
roundeven_test = env.Program(
target = 'roundeven_test',
source = ['roundeven_test.c'],
)
env.UnitTest("roundeven_test", roundeven_test)
env.Prepend(LIBS = [mesautil])
mesa_sha1_test = env.Program(
target = 'mesa-sha1_test',
source = ['mesa-sha1_test.c'],
)
env.UnitTest("mesa-sha1_test", mesa_sha1_test)