1 # Written by Victor Grishchenko, Arno Bakker
2 # see LICENSE.txt for license information
5 # - scons: Cross-platform build system http://www.scons.org/
6 # - googletest: Google C++ Test Framework http://code.google.com/p/googletest/
7 # * Install in ..\gtest-1.4.0
19 source = [ 'bin64.cpp','sha1.cpp','hashtree.cpp','datagram.cpp','bins.cpp',
20 'transfer.cpp', 'channel.cpp', 'sendrecv.cpp', 'send_control.cpp',
24 if sys.platform == "win32":
25 # "MSVC works out of the box". Sure.
26 # Make sure scons finds cl.exe, etc.
27 env.Append ( ENV = { 'PATH' : os.environ['PATH'] } )
29 # Make sure scons finds std MSVC include files
30 if not 'INCLUDE' in os.environ:
31 print "swift: Please run scons in a Visual Studio Command Prompt"
34 include = os.environ['INCLUDE']
35 include += '..\\gtest-1.4.0\\include;'
36 include += '\\openssl\\include;'
38 env.Append ( ENV = { 'INCLUDE' : include } )
40 # Other compiler flags
41 env.Append(CPPPATH=".")
43 env.Append(CXXFLAGS="/Zi /Yd /MTd")
44 env.Append(LINKFLAGS="/DEBUG")
46 # Add simulated pread/write
47 source += ['compat/unixio.cpp']
52 libs += ['gtestd','libeay32MTd']
54 libs += ['gtest','libeay32']
56 # Update lib search path
57 libpath = os.environ['LIBPATH']
59 libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Debug;'
60 libpath += '\\openssl\\lib\\VC\\static;'
62 libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Release;'
63 libpath += '\\openssl\\lib;'
64 # Somehow linker can't find uuid.lib
65 libpath += 'C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib;'
68 # Enable the user defining external includes
69 if 'CPPPATH' in os.environ:
70 cpppath = os.environ['CPPPATH']
73 print "To use external libs, set CPPPATH environment variable to list of colon-separated include dirs"
74 env.Append(CPPPATH=".:"+cpppath)
75 #env.Append(LINKFLAGS="--static")
78 # env.Append(CXXFLAGS="-g")
81 libs = ['stdc++','pthread']
82 if 'LIBPATH' in os.environ:
83 libpath = os.environ['LIBPATH']
86 print "To use external libs, set LIBPATH environment variable to list of colon-separated lib dirs"
89 env.Append(CXXFLAGS="-DDEBUG")
99 source=['swift.cpp','httpgw.cpp'],
101 LIBS=[libs,'libswift'],
102 LIBPATH=libpath+':.' )
108 SConscript('tests/SConscript')