refactor build for tree of scons makefiles, fix out of source build, correct target handling

This commit is contained in:
Tobias Oberstein committed 2012-03-08 17:55:13 +01:00
1 parent ae2dac32f0
commit 16a4ba98b4
5 files changed
+91 -50

No files matched your search

+1 -1
View File
@@ -47,4 +47,4 @@ examples/wsperf/wsperf
.sconsign.dblite
release/
build/
+25 -49
View File
@@ -63,15 +63,12 @@ elif env['PLATFORM'] == 'posix':
#env['LINKFLAGS'] = ''
env.VariantDir("release/", "src/");
if env['PLATFORM'].startswith('win'):
lib_path = env['BOOST_LIBS']
env['LIBPATH'] = env['BOOST_LIBS']
else:
lib_path = ['/usr/lib',
'/usr/local/lib',
env['BOOST_LIBS'],
'#/release']
env['LIBPATH'] = ['/usr/lib',
'/usr/local/lib',
env['BOOST_LIBS']]
platform_libs = []
if env['PLATFORM'] == 'posix':
@@ -80,51 +77,30 @@ elif env['PLATFORM'].startswith('win'):
# Win/VC++ supports autolinking. nothing to do.
pass
#### END OF GLOBAL CONF ########################################################
## WebSocket++ library
##
lib_sources = ["base64/base64.cpp",
"md5/md5.c",
"messages/data.cpp",
"network_utilities.cpp",
"processors/hybi_header.cpp",
"sha1/sha1.cpp",
"uri.cpp"]
releasedir = 'build/release/'
debugdir = 'build/debug/'
builddir = releasedir
static_lib = env.StaticLibrary(target = 'release/websocketpp',
source = lib_sources,
srcdir = "release")
#shared_lib=env.SharedLibrary(target = 'release/websocketpp', source = lib_sources, srcdir="release",LIBS=['boost_regex'],LIBPATH=lib_path)
Export('env')
Export('platform_libs')
Export('boostlibs')
## END OF CONFIG !!
## TARGETS:
static_lib, shared_lib = SConscript('src/SConscript',
variant_dir = builddir + 'websocketpp',
duplicate = 0)
wslib = static_lib
Export('wslib')
## Echo Server
##
env.VariantDir("#/release/echo_server", "examples/echo_server")
env.Program(target = "#/release/echo_server/echo_server",
srcdir = "#/release/echo_server/",
source = ["echo_server.cpp"],
LIBS = [wslib, platform_libs] + boostlibs(['system',
'date_time',
'regex',
'thread']),
LIBPATH = lib_path)
wsperf = SConscript('#/examples/wsperf/SConscript',
variant_dir = builddir + 'wsperf',
duplicate = 0)
## wsperf
##
env.VariantDir("#/release/wsperf", "examples/wsperf")
env.Program(target = "#/release/wsperf/wsperf",
srcdir = "#/release/wsperf/",
source = ["wsperf.cpp",
"request.cpp",
"case.cpp",
"generic.cpp"],
LIBS = [wslib, platform_libs] + boostlibs(['system',
'date_time',
'regex',
'thread',
'random',
'chrono',
'program_options']),
LIBPATH = lib_path)
echo_server = SConscript('#/examples/echo_server/SConscript',
variant_dir = builddir + 'echo_server',
duplicate = 0)
+20
View File
@@ -0,0 +1,20 @@
## echo_server
##
Import('env')
Import('boostlibs')
Import('wslib')
Import('platform_libs')
localenv = env.Clone ()
sources = ["echo_server.cpp"]
LIBS = [wslib, platform_libs] + boostlibs(['system',
'date_time',
'regex',
'thread'])
prg = localenv.Program('echo_server', sources, LIBS = LIBS)
Return('prg')
+26
View File
@@ -0,0 +1,26 @@
## wsperf
##
Import('env')
Import('boostlibs')
Import('wslib')
Import('platform_libs')
localenv = env.Clone ()
sources = ["wsperf.cpp",
"request.cpp",
"case.cpp",
"generic.cpp"]
LIBS = [wslib, platform_libs] + boostlibs(['system',
'date_time',
'regex',
'thread',
'random',
'chrono',
'program_options'])
prg = localenv.Program('wsperf', sources, LIBS = LIBS)
Return('prg')
+19
View File
@@ -0,0 +1,19 @@
## websocket++ library
##
Import('env')
localenv = env.Clone ()
sources = ["base64/base64.cpp",
"md5/md5.c",
"messages/data.cpp",
"network_utilities.cpp",
"processors/hybi_header.cpp",
"sha1/sha1.cpp",
"uri.cpp"]
static_lib = localenv.StaticLibrary('websocketpp', sources)
shared_lib = None # localenv.SharedLibrary('websocketpp', sources)
Return('static_lib', 'shared_lib')