add .gitignore
[swift-upb.git] / SConstruct
index a2155b1..ef52d27 100644 (file)
@@ -5,10 +5,6 @@
 #  - scons: Cross-platform build system    http://www.scons.org/
 #  - googletest: Google C++ Test Framework http://code.google.com/p/googletest/
 #       * Install in ..\gtest-1.4.0
-#  - OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
-#       * Install non-light Win32 binary in \openssl
-#       * Using a openssl-0.9.8k tar-ball doesn't work as the includes there
-#         are symbolic links which get turned into 0 length files by 7Zip. 
 #
 
 import os
@@ -19,10 +15,10 @@ DEBUG = True
 
 TestDir='tests'
 
-target = 'p2tp'
+target = 'swift'
 source = [ 'bin64.cpp','sha1.cpp','hashtree.cpp','datagram.cpp','bins.cpp',
-    'transfer.cpp', 'p2tp.cpp', 'sendrecv.cpp', 'ext/send_control.cpp',
-    'compat/hirestimeofday.cpp', 'compat.cpp', 'compat/util.cpp']
+    'transfer.cpp', 'channel.cpp', 'sendrecv.cpp', 'send_control.cpp',
+    'compat.cpp']
 
 env = Environment()
 if sys.platform == "win32":
@@ -32,7 +28,7 @@ if sys.platform == "win32":
 
        # Make sure scons finds std MSVC include files
        if not 'INCLUDE' in os.environ:
-               print "p2tp: Please run scons in a Visual Studio Command Prompt"
+               print "swift: Please run scons in a Visual Studio Command Prompt"
                sys.exit(-1)
                
        include = os.environ['INCLUDE']
@@ -82,22 +78,31 @@ else:
        #       env.Append(CXXFLAGS="-g")
 
        # Set libs to link to
-       libs = ['stdc++','gtest','pthread','crypto']
+       libs = ['stdc++','pthread']
        if 'LIBPATH' in os.environ:
            libpath = os.environ['LIBPATH']
        else:
            libpath = ""
            print "To use external libs, set LIBPATH environment variable to list of colon-separated lib dirs"
 
+if DEBUG:
+       env.Append(CXXFLAGS="-DDEBUG")
+
 env.StaticLibrary (
-    target= target,
+    target='libswift',
     source = source,
     LIBS=libs,
     LIBPATH=libpath )
 
+env.Program(
+   target='swift',
+   source=['swift.cpp','httpgw.cpp'],
+   CPPPATH=cpppath,
+   LIBS=[libs,'libswift'],
+   LIBPATH=libpath+':.' )
+
 Export("env")
 Export("libs")
 Export("libpath")
 Export("DEBUG")
 SConscript('tests/SConscript')
-SConscript('exec/SConscript')