1 #############################################################################
3 # Copyright 2008 Tungsten Graphics, Inc.
5 # This program is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published
7 # by the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #############################################################################
24 opts = Options('config.py')
25 opts.Add(BoolOption('debug', 'build debug version', 'no'))
26 opts.Add(PathOption('dxsdk', 'DirectX SDK installation dir', os.environ.get('DXSDK_DIR', 'C:\\DXSDK')))
27 opts.Add(EnumOption('MSVS_VERSION', 'Microsoft Visual Studio version', None, allowed_values=('7.1', '8.0', '9.0')))
32 Help(opts.GenerateHelpText(env))
34 env.Append(CPPDEFINES = [
39 '_CRT_SECURE_NO_DEPRECATE',
40 '_CRT_NON_CONFORMING_SWPRINTFS',
41 'WIN32_LEAN_AND_MEAN',
43 ('_WIN32_WINNT', '0x0501'), # minimum required OS version
47 env.Append(CPPDEFINES = ['_DEBUG'])
49 env.Append(CPPDEFINES = ['NDEBUG'])
50 env['PDB'] = '${TARGET.base}.pdb'
53 '/W4', # warning level
57 '/Od', # disable optimizations
58 '/Oy-', # disable frame pointer omission
62 '/Ox', # maximum optimizations
63 '/Os', # favor code space
66 '/Oi', # enable intrinsic functions
67 '/GF', # enable read-only string pooling
70 env.Append(CFLAGS = cflags)
71 env.Append(CXXFLAGS = cflags)
80 SConscript('zlib/SConscript')
82 env.Append(CPPPATH = [
83 os.path.join(env['dxsdk'], 'Include'),
87 has_d3d9 = conf.CheckCHeader('d3d9.h')
88 has_d3d8 = conf.CheckCHeader('d3d8.h')
89 has_d3d7 = conf.CheckCHeader('ddraw.h')
95 source = ['ddraw.py', 'd3d.py', 'd3dtypes.py', 'd3dcaps.py', 'windows.py', 'base.py'],
96 action = 'python $SOURCE > $TARGET',
99 ddraw = env.SharedLibrary(
113 source = ['d3d8.py', 'd3d8types.py', 'd3d8caps.py', 'windows.py', 'base.py'],
114 action = 'python $SOURCE > $TARGET',
117 d3d8 = env.SharedLibrary(
131 source = ['d3d9.py', 'd3d9types.py', 'd3d9caps.py', 'windows.py', 'base.py'],
132 action = 'python $SOURCE > $TARGET',
135 d3d9 = env.SharedLibrary(
147 target = 'opengl32.cpp',
148 source = ['opengl32.py', 'gl.py', 'windows.py', 'base.py'],
149 action = 'python $SOURCE > $TARGET',
152 opengl32 = env.SharedLibrary(
161 env.Default(opengl32)
163 env.Tool('packaging')
171 SUMMARY = 'Tool to trace Direct3D & OpenGL API calls from applications.',
172 SOURCE_URL = 'http://cgit.freedesktop.org/~jrfonseca/apitrace/',
185 env.Alias('zip', zip)