- Relative/Templated paths for MSVC

- Waf wscript


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@985 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2007-01-09 23:01:15 +00:00
parent f723a42e50
commit a43cf9bfb2
2 changed files with 122 additions and 4 deletions

View File

@ -50,7 +50,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;D:\Dokumente und Einstellungen\Admin\Desktop\Warzone2100&quot;;&quot;D:\Programme\DevPkg\include&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\..&quot;;&quot;__DEVPKG__\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;YY_NO_UNISTD_H;VERSION=\&quot;TRUNK\&quot;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -74,7 +74,7 @@
AdditionalDependencies="SDL.lib SDLmain.lib SDL_net.lib jpeg.lib png.lib zlib.lib ogg.lib vorbis.lib vorbisfile.lib mad.lib physfs.lib OpenAL32.lib OpenGL32.lib GLU32.lib shfolder.lib"
OutputFile="$(OutDir)\$(ProjectName)-Dbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;D:\Programme\DevPkg\lib&quot;"
AdditionalLibraryDirectories="&quot;__DEVPKG__\lib&quot;"
IgnoreDefaultLibraryNames="msvcrt.lib libcmt.lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -136,7 +136,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;D:\Dokumente und Einstellungen\Admin\Desktop\Warzone2100&quot;;&quot;D:\Programme\DevPkg\include&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\..&quot;;&quot;__DEVPKG__\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;YY_NO_UNISTD_H;VERSION=\&quot;TRUNK\&quot;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
@ -157,7 +157,7 @@
Name="VCLinkerTool"
AdditionalDependencies="SDL.lib SDLmain.lib SDL_net.lib jpeg.lib png.lib zlib.lib ogg.lib vorbis.lib vorbisfile.lib mad.lib physfs.lib OpenAL32.lib OpenGL32.lib GLU32.lib shfolder.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;D:\Programme\DevPkg\lib&quot;"
AdditionalLibraryDirectories="&quot;__DEVPKG__\lib&quot;"
IgnoreDefaultLibraryNames="libcmt.lib"
GenerateDebugInformation="true"
SubSystem="2"

118
wscript Normal file
View File

@ -0,0 +1,118 @@
#! /usr/bin/env python
# encoding: utf-8
# Dennis Schridde, 2006 (devurandom)
# Warzone 2100
# the following two variables are used by the target "waf dist"
VERSION='TRUNK'
APPNAME='Warzone 2100'
# these variables are mandatory ('/' are converted automatically)
srcdir = '.'
blddir = '_build_'
# make sure waf has the version we want
import Utils
Utils.waf_version(mini="1.0", maxi="9.9.9")
# For DEFAULT_DATADIR and debug variant
import Params
def set_options(opt):
#add option for additional/external includes and library dirs for MinGW on Windows
opt.add_option('--debug',
action='store_true',
default=False,
help='Build debug variant [Default: False]',
dest='debug')
def configure(conf):
# Use either GCC or MSVC, not both (will fail)
if not conf.check_tool('gcc'):
conf.check_tool('msvc')
# Check for the Lexer/Parser tools and get the checks module for checkEndian
conf.check_tool('flex bison checks')
# Big or little endian?
conf.checkEndian()
# Check for all required libs
if not conf.check_pkg2('sdl', '1.2', 0):
if not conf.check_cfg2('sdl', 0):
conf.check_header('SDL/SDL.h')
conf.check_library('SDL')
conf.check_library('SDLmain')
if not conf.check_pkg2('openal', '0', 0):
conf.check_header2('AL/al.h')
conf.check_library2('openal')
if not conf.check_pkg2('libpng', '1.2', 0, 'PNG'):
conf.check_header2('png.h')
conf.check_library2('png')
if not conf.check_pkg2('mad', '0.15', 0):
conf.check_header2('mad.h')
conf.check_library2('mad')
if not conf.check_pkg2('ogg', '1.0', 0):
conf.check_header2('ogg/ogg.h')
conf.check_library2('ogg')
if not conf.check_pkg2('vorbisfile', '1.0', 0):
conf.check_header2('vorbis/vorbisfile.h')
conf.check_library2('vorbisfile')
conf.check_header2('SDL/SDL_net.h')
conf.check_library2('SDL_net')
conf.check_header2('GL/gl.h')
conf.check_library2('GL')
conf.check_header2('GL/glu.h')
conf.check_library2('GLU')
conf.check_header2('physfs.h')
conf.check_library2('physfs')
conf.check_header2('jconfig.h')
conf.check_library2('jpeg')
# Common defines
conf.env['CCFLAGS'] += ['-Idebug/lib/framework', '-Idebug/lib/script', '-Idebug/src']
conf.add_define('VERSION', VERSION)
conf.add_define('DEFAULT_DATADIR', Params.g_options.prefix + 'warzone2100')
conf.add_define('YY_STATIC', 1)
# Split off debug variant before adding variant specific defines
conf.set_env_name('debug', conf.env.deepcopy())
# Configure non debug variant
conf.env['CCFLAGS'] += ['-g0', '-O2']
conf.add_define('NDEBUG', 1)
conf.write_config_header()
# Configure debug variant
conf.setenv('debug')
conf.env.set_variant('debug')
conf.env['CCFLAGS'] += ['-g2', '-O0', '-Wall', '-Wextra', '-Wwrite-strings', '-Wcast-qual', '-Wmissing-declarations', '-Wstrict-prototypes', '-Wold-style-definition']
conf.add_define('DEBUG', 1)
conf.write_config_header()
def build(bld):
obj = bld.create_obj('cc', 'program')
obj.find_sources_in_dirs('lib/framework lib/gamelib lib/netplay lib/ivis_common lib/ivis_opengl lib/script lib/sequence lib/sound lib/widget src')
obj.uselib='PNG JPEG MAD OGG VORBISFILE GLU GL OPENAL PHYSFS SDL_NET SDL SDLMAIN'
obj.defines='HAVE_CONFIG_H'
obj.target='warzone2100'
# Use debug environment when --enable-debug is given
if Params.g_options.debug:
obj.env = bld.env_of_name('debug')