mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 00:30:13 +01:00
It was much easier for me to verify things build and run as expected with this simple test, than building and testing whole Mesa. With scons the test can be build and run merely by doing: scons u_atomic_test Building the test with autotools is left as a future exercise. Reviewed-by: Matt Turner <mattst88@gmail.com>
47 lines
907 B
Python
47 lines
907 B
Python
import common
|
|
|
|
Import('*')
|
|
|
|
from sys import executable as python_cmd
|
|
|
|
env = env.Clone()
|
|
|
|
env.Prepend(CPPPATH = [
|
|
'#include',
|
|
'#src',
|
|
'#src/mapi',
|
|
'#src/mesa',
|
|
'#src/util',
|
|
])
|
|
|
|
env.CodeGenerate(
|
|
target = 'format_srgb.c',
|
|
script = 'format_srgb.py',
|
|
source = [],
|
|
command = python_cmd + ' $SCRIPT > $TARGET'
|
|
)
|
|
|
|
# parse Makefile.sources
|
|
source_lists = env.ParseSourceList('Makefile.sources')
|
|
|
|
mesautil_sources = (
|
|
source_lists['MESA_UTIL_FILES'] +
|
|
source_lists['MESA_UTIL_GENERATED_FILES']
|
|
)
|
|
|
|
mesautil = env.ConvenienceLibrary(
|
|
target = 'mesautil',
|
|
source = mesautil_sources,
|
|
)
|
|
|
|
env.Alias('mesautil', mesautil)
|
|
Export('mesautil')
|
|
|
|
|
|
# http://www.scons.org/wiki/UnitTests
|
|
u_atomic_test = env.Program(
|
|
target = 'u_atomic_test',
|
|
source = ['u_atomic_test.c'],
|
|
)
|
|
alias = env.Alias("u_atomic_test", u_atomic_test, u_atomic_test[0].abspath)
|
|
AlwaysBuild(alias)
|