Index: SConstruct =================================================================== --- SConstruct (revision 16) +++ SConstruct (working copy) @@ -38,14 +38,28 @@ user = os.environ['USERNAME'].split()[0] DEFINES = ['USER_%s' % user] +CCFLAGS = [] +LINKFLAGS = ["/DEBUG"] +if sys.platform == 'win32': + # need this to find main entry point for apps on windows + LINKFLAGS += ["/SUBSYSTEM:WINDOWS"] if buildmode == 'debug': - CCFLAGS = Split("-g -Wall") DEFINES += Split("-DDEBUG") + if sys.platform == 'win32': + # adds debug multithreading and debuggiing optimizations on windows (?) + CCFLAGS += ["/MDd", "/Od"] + else: + CCFLAGS += Split("-g -Wall") + elif buildmode == 'release': - CCFLAGS = Split("-O2") # -DNDEBUG will disable asserts DEFINES += Split("-DNDEBUG") + # adds multithreading on windows and some optimizations + if sys.platform == 'win32': + CCFLAGS += ["/MD", "/Ox"] + else: + CCFLAGS = Split("-O2") def EnvRequire(env, require): print "requiring %s..." % require @@ -56,18 +70,22 @@ env.ParseConfig('sdl-config --libs --cflags') else: print "passing paths" - env.Append(CPPPATH="$SDL_INCLUDE_PATH") - env.Append(LINKFLAGS="$SDL_LIB_PATH") - env.Append(LIBS="SDL") + env.Append(CPPPATH=["${SDL_INCLUDE_PATH}"]) + env.Append(LIBPATH=["${SDL_LIB_PATH}"]) + env.Append(LIBS=["SDL"]) + if sys.platform == 'win32': + env.Append(LIBS=["SDLmain"]) + elif require.startswith('boost_'): env.AppendUnique(CPPPATH=["${BOOST_INCLUDE_PATH}"]) env.AppendUnique(LIBPATH=["${BOOST_LIB_PATH}"]) - env.Append(LIBS=require) + if sys.platform != 'win32': + env.Append(LIBS=require) elif require == 'python': - env.Append(CPPPATH="${PYTHON_INCLUDE_PATH}") - env.Append(LIBPATH="${PYTHON_LIB_PATH}") + env.Append(CPPPATH=["${PYTHON_INCLUDE_PATH}"]) + env.Append(LIBPATH=["${PYTHON_LIB_PATH}"]) env.Append(LIBS="python2.4") elif require == 'GL': @@ -88,7 +106,7 @@ SConsEnvironment.Require = EnvRequire # root environment for all other environments to copy from -rootenv = Environment(options=opts, CCFLAGS = CCFLAGS, CPPDEFINES = DEFINES) +rootenv = Environment(options=opts, CCFLAGS = CCFLAGS, CPPDEFINES = DEFINES, LINKFLAGS=LINKFLAGS) Help(opts.GenerateHelpText(rootenv)) rootenv.SConsignFile() Index: libs/LSD/include/LSD.h =================================================================== --- libs/LSD/include/LSD.h (revision 16) +++ libs/LSD/include/LSD.h (working copy) @@ -1,3 +1,14 @@ +// windows gubbins +#pragma comment(lib, "SDL.lib") +#pragma comment(lib, "SDLmain.lib") +//SDL_Image is a library for loading jpg,png,etc... +//#pragma comment(lib, "SDL_Image.lib") +//SDL_ttf is a library for text output +//(there are of course other possibilities to do this) +//#pragma comment(lib, "SDL_ttf.lib") +//SDL_mixer is essential for sound/music... +//#pragma comment(lib, "SDL_mixer.lib") + #include "LSD/sys.h" #include "LSD/window.h" #include "LSD/event.h" Index: libs/LSD/SConscript =================================================================== --- libs/LSD/SConscript (revision 16) +++ libs/LSD/SConscript (working copy) @@ -4,6 +4,9 @@ LSDenv = rootenv.Copy() LSDenv.Require('SDL') +#LSDenv.Append(CPPPATH=r"E:\projects\include\SDL\SDL-1.2.11\include") +#LSDenv.Append(LIBPATH=r"E:\projects\include\SDL\SDL-1.2.11\lib") +#LSDenv.Append( LIBS=Split("SDL SDLmain") ) LSDenv.Require('boost_signals') LSDenv.Require('GL') Index: libs/LSD/examples/ex2.cpp =================================================================== --- libs/LSD/examples/ex2.cpp (revision 16) +++ libs/LSD/examples/ex2.cpp (working copy) @@ -17,4 +17,6 @@ clock->update(); printf("%f\n", clock->frameTime()); }; + + return 0; }; Index: libs/LSD/examples/ex3.cpp =================================================================== --- libs/LSD/examples/ex3.cpp (revision 16) +++ libs/LSD/examples/ex3.cpp (working copy) @@ -14,6 +14,15 @@ gRunning = false; }; +namespace boost { + +void throw_exception(std::exception const & e) +{ + +}; + +} + int main(int argc, char** argv) { LSD::cSystem::instance(); @@ -35,4 +44,6 @@ { eventmgr->update(); }; + + return 0; }; Index: libs/LSD/examples/ex4.cpp =================================================================== --- libs/LSD/examples/ex4.cpp (revision 16) +++ libs/LSD/examples/ex4.cpp (working copy) @@ -12,6 +12,15 @@ printf("but down %u %u %u\n", but, x, y); }; +namespace boost { + +void throw_exception(std::exception const & e) +{ + +}; + +} + int main(int argc, char** argv) { LSD::cSystem::instance(); @@ -34,4 +43,6 @@ { eventmgr->update(); }; + + return 0; }; Index: libs/LSD/examples/ex1.cpp =================================================================== --- libs/LSD/examples/ex1.cpp (revision 16) +++ libs/LSD/examples/ex1.cpp (working copy) @@ -1,7 +1,7 @@ #include "LSD/sys.h" #include "LSD/window.h" -int main(int argc, char** argv) +int main(int argc, char* argv[]) { LSD::cSystem::instance();