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',
46 env.Append(CPPDEFINES = ['_DEBUG'])
48 env.Append(CPPDEFINES = ['NDEBUG'])
49 env['PDB'] = '${TARGET.base}.pdb'
52 '/W4', # warning level
56 '/Od', # disable optimizations
57 '/Oy-', # disable frame pointer omission
61 '/Ox', # maximum optimizations
62 '/Os', # favor code space
65 '/Oi', # enable intrinsic functions
66 '/GF', # enable read-only string pooling
69 env.Append(CFLAGS = cflags)
70 env.Append(CXXFLAGS = cflags)
79 SConscript('zlib/SConscript')
81 env.Append(CPPPATH = [
82 os.path.join(env['dxsdk'], 'Include'),
86 has_d3d9 = conf.CheckCHeader('d3d9.h')
87 has_d3d8 = conf.CheckCHeader('d3d8.h')
93 source = ['d3d8.py', 'd3d8types.py', 'd3d8caps.py', 'windows.py', 'base.py'],
94 action = 'python $SOURCE > $TARGET',
97 d3d8 = env.SharedLibrary(
111 source = ['d3d9.py', 'd3d9types.py', 'd3d9caps.py', 'windows.py', 'base.py'],
112 action = 'python $SOURCE > $TARGET',
115 d3d9 = env.SharedLibrary(
127 target = 'opengl32.cpp',
128 source = ['opengl32.py', 'gl.py', 'windows.py', 'base.py'],
129 action = 'python $SOURCE > $TARGET',
132 opengl32 = env.SharedLibrary(
141 env.Default(opengl32)
143 env.Tool('packaging')
151 SUMMARY = 'Tool to trace Direct3D API calls from applications.',
152 SOURCE_URL = 'http://cgit.freedesktop.org/~jrfonseca/d3dtrace/',
165 env.Alias('zip', zip)