From 0832ab5e823027f63d9d4638571b9b417a99b694 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Wed, 7 Mar 2012 15:19:07 +0100 Subject: [PATCH 1/7] make vc build work again --- windows/vcpp2010/examples/wsperf/wsperf.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/vcpp2010/examples/wsperf/wsperf.vcxproj b/windows/vcpp2010/examples/wsperf/wsperf.vcxproj index 9886234e41..dce6ac4ef4 100644 --- a/windows/vcpp2010/examples/wsperf/wsperf.vcxproj +++ b/windows/vcpp2010/examples/wsperf/wsperf.vcxproj @@ -65,7 +65,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _WEBSOCKETPP_CPP11_FRIEND_;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) $(BOOSTROOT);..;%(AdditionalIncludeDirectories) MultiThreaded false From aac25f95320108fdb087806eb638e846eb6d5259 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Wed, 7 Mar 2012 15:58:02 +0100 Subject: [PATCH 2/7] Fix/silence warnings on vc++ --- examples/wsperf/generic.hpp | 8 ++++---- src/connection.hpp | 2 +- src/messages/data.cpp | 2 +- src/roles/client.hpp | 10 ++++++++++ src/roles/server.hpp | 10 ++++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/examples/wsperf/generic.hpp b/examples/wsperf/generic.hpp index 0b86a7f288..77e6f884b2 100644 --- a/examples/wsperf/generic.hpp +++ b/examples/wsperf/generic.hpp @@ -94,13 +94,13 @@ public: void on_open(connection_ptr con) { m_msg = con->get_data_message(); - m_data.reserve(m_message_size); + m_data.reserve(static_cast(m_message_size)); if (!m_binary) { - fill_utf8(m_data,m_message_size,true); + fill_utf8(m_data,static_cast(m_message_size),true); m_msg->reset(websocketpp::frame::opcode::TEXT); } else { - fill_binary(m_data,m_message_size,true); + fill_binary(m_data,static_cast(m_message_size),true); m_msg->reset(websocketpp::frame::opcode::BINARY); } @@ -142,7 +142,7 @@ public: } private: // Simulation Parameters - size_t m_message_size; + uint64_t m_message_size; uint64_t m_message_count; uint64_t m_timeout; bool m_binary; diff --git a/src/connection.hpp b/src/connection.hpp index 4a14d054a1..a4432a0c95 100644 --- a/src/connection.hpp +++ b/src/connection.hpp @@ -348,7 +348,7 @@ public: boost::asio::async_read( socket_type::get_socket(), m_buf, - boost::asio::transfer_at_least(m_processor->get_bytes_needed()), + boost::asio::transfer_at_least(static_cast(m_processor->get_bytes_needed())), boost::bind( &type::handle_read_frame, type::shared_from_this(), diff --git a/src/messages/data.cpp b/src/messages/data.cpp index 4765edc10b..4e95a2c087 100644 --- a/src/messages/data.cpp +++ b/src/messages/data.cpp @@ -58,7 +58,7 @@ uint64_t data::process_payload(std::istream& input,uint64_t size) { if (new_size > m_payload.capacity()) { m_payload.reserve(std::max( - new_size, static_cast(2*m_payload.capacity()) + static_cast(new_size), static_cast(2*m_payload.capacity()) )); } diff --git a/src/roles/client.hpp b/src/roles/client.hpp index 68dbe0d3e4..c0ed9e8c36 100644 --- a/src/roles/client.hpp +++ b/src/roles/client.hpp @@ -45,6 +45,12 @@ #include +#ifdef _MSC_VER +// Disable "warning C4355: 'this' : used in base member initializer list". +# pragma warning(push) +# pragma warning(disable:4355) +#endif + using boost::asio::ip::tcp; namespace websocketpp { @@ -531,4 +537,8 @@ void client::connection::log_open_result() { } // namespace role } // namespace websocketpp +#ifdef _MSC_VER +# pragma warning(pop) +#endif + #endif // WEBSOCKETPP_ROLE_CLIENT_HPP diff --git a/src/roles/server.hpp b/src/roles/server.hpp index 3eb8f78b85..822f37a7cb 100644 --- a/src/roles/server.hpp +++ b/src/roles/server.hpp @@ -44,6 +44,12 @@ #include #include +#ifdef _MSC_VER +// Disable "warning C4355: 'this' : used in base member initializer list". +# pragma warning(push) +# pragma warning(disable:4355) +#endif + namespace websocketpp { // Forward declarations @@ -644,4 +650,8 @@ void server::connection::log_open_result() { } // namespace role } // namespace websocketpp +#ifdef _MSC_VER +# pragma warning(pop) +#endif + #endif // WEBSOCKETPP_ROLE_SERVER_HPP From 4c5421e3fa2945073c9df691a60d434bb6d2c340 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Wed, 7 Mar 2012 17:14:21 +0100 Subject: [PATCH 3/7] Basically rewrite SConstruct. VC++ builds without warns. Still needs variant dir / targets fixed. --- SConstruct | 121 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 106 insertions(+), 15 deletions(-) diff --git a/SConstruct b/SConstruct index 7045798332..f8192198e6 100644 --- a/SConstruct +++ b/SConstruct @@ -7,24 +7,115 @@ #env = Environment(PREFIX = GetOption('prefix')) -env = Environment() # Initialize the environment +import os, sys +env = Environment(ENV = os.environ) + +## Boost +## +## Note: You need to either set BOOSTROOT to the root of a stock Boost distribution +## or set BOOST_INCLUDES and BOOST_LIBS if Boost comes with your OS distro e.g. and +## needs BOOST_INCLUDES=/usr/include/boost and BOOST_LIBS=/usr/lib like Ubuntu. +## +if os.environ.has_key('BOOSTROOT'): + env['BOOST_INCLUDES'] = os.environ['BOOSTROOT'] + env['BOOST_LIBS'] = os.path.join(os.environ['BOOSTROOT'], 'stage', 'lib') +elif os.environ.has_key('BOOST_INCLUDES') and os.environ.has_key('BOOST_LIBS'): + env['BOOST_INCLUDES'] = os.environ['BOOST_INCLUDES'] + env['BOOST_LIBS'] = os.environ['BOOST_LIBS'] +else: + raise SCons.Errors.UserError, "Neither BOOSTROOT, nor BOOST_INCLUDES + BOOST_LIBS was set!" + +env.Append(CPPPATH = [env['BOOST_INCLUDES']]) +env.Append(LIBPATH = [env['BOOST_LIBS']]) + +boost_linkshared = False + +def boostlibs(libnames): + if env['PLATFORM'].startswith('win'): + # Win/VC++ supports autolinking. nothing to do. + # http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html#auto-linking + return [] + else: + libs = [] + prefix = 'SHLIBPREFIX' if boost_linkshared else 'LIBPREFIX' + suffix = 'SHLIBSUFFIX' if boost_linkshared else 'LIBSUFFIX' + for name in libnames: + lib = File(os.path.join(env['BOOST_LIBS'], '%sboost_%s%s' % (prefix, name, suffix))) + libs.append(lib) + return libs + + +if env['PLATFORM'].startswith('win'): + env.Append(CPPDEFINES = ['WIN32', 'NDEBUG', '_CONSOLE', '_WEBSOCKETPP_CPP11_FRIEND_']) + arch_flags = '/arch:SSE2' + opt_flags = '/Ox /Oi /fp:fast' + warn_flags = '/W3 /wd4996 /wd4995 /wd4355' + env['CCFLAGS'] = '%s /EHsc /GR /GS- /MD /nologo %s %s' % (warn_flags, arch_flags, opt_flags) + env['LINKFLAGS'] = '/INCREMENTAL:NO /MANIFEST /NOLOGO /OPT:REF /OPT:ICF /MACHINE:X86' + env.VariantDir("release/", "src/"); -lib_sources = ["base64/base64.cpp","md5/md5.c","messages/data.cpp","network_utilities.cpp","processors/hybi_header.cpp","sha1/sha1.cpp","uri.cpp"] -lib_path = ['/usr/lib','/usr/local/lib','#/release'] +if env['PLATFORM'].startswith('win'): + lib_path = env['BOOST_LIBS'] +else: + lib_path = ['/usr/lib', + '/usr/local/lib', + env['BOOST_LIBS'], + '#/release'] -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) - -# 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=[shared_lib,'boost_system','boost_date_time','boost_regex','boost_thread','pthread'],LIBPATH=lib_path) - -lib_rt = '' +platform_libs = [] if env['PLATFORM'] == 'posix': - lib_rt = 'rt' + platform_libs = ['pthread', 'rt'] +elif env['PLATFORM'].startswith('win'): + # Win/VC++ supports autolinking. nothing to do. + pass -# Echo Server -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=[shared_lib,'boost_system','boost_date_time','boost_regex','boost_thread','pthread',lib_rt,'boost_random','boost_chrono','boost_program_options'],LIBPATH=lib_path) \ No newline at end of file +#### 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"] + +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) + +wslib = static_lib + +## 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 +## +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) From 48ac9e7042d37b205a825bf0fd150aa75570320a Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Thu, 8 Mar 2012 16:55:23 +0100 Subject: [PATCH 4/7] use std::limits instead of macros, reorder includes, fix build --- SConstruct | 7 +++++++ src/roles/client.hpp | 19 ++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/SConstruct b/SConstruct index d188dea174..606ad855ea 100644 --- a/SConstruct +++ b/SConstruct @@ -52,6 +52,13 @@ if env['PLATFORM'].startswith('win'): warn_flags = '/W3 /wd4996 /wd4995 /wd4355' env['CCFLAGS'] = '%s /EHsc /GR /GS- /MD /nologo %s %s' % (warn_flags, arch_flags, opt_flags) env['LINKFLAGS'] = '/INCREMENTAL:NO /MANIFEST /NOLOGO /OPT:REF /OPT:ICF /MACHINE:X86' +elif env['PLATFORM'] == 'posix': + env.Append(CPPDEFINES = ['NDEBUG']) + arch_flags = '' + opt_flags = '-O2' + warn_flags = '-Wall' + env['CCFLAGS'] = '%s %s %s' % (warn_flags, arch_flags, opt_flags) + #env['LINKFLAGS'] = '' env.VariantDir("release/", "src/"); diff --git a/src/roles/client.hpp b/src/roles/client.hpp index c0ed9e8c36..3b9fe773a3 100644 --- a/src/roles/client.hpp +++ b/src/roles/client.hpp @@ -28,22 +28,19 @@ #ifndef WEBSOCKETPP_ROLE_CLIENT_HPP #define WEBSOCKETPP_ROLE_CLIENT_HPP -#include "../endpoint.hpp" -#include "../uri.hpp" -#include "../shared_const_buffer.hpp" - -#ifndef __STDC_LIMIT_MACROS - #define __STDC_LIMIT_MACROS -#endif -#include +#include +#include +#include #include #include #include #include #include -#include +#include "../endpoint.hpp" +#include "../uri.hpp" +#include "../shared_const_buffer.hpp" #ifdef _MSC_VER // Disable "warning C4355: 'this' : used in base member initializer list". @@ -209,8 +206,8 @@ public: client (boost::asio::io_service& m) : m_endpoint(static_cast< endpoint_type& >(*this)), m_io_service(m), - m_gen(m_rng,boost::random::uniform_int_distribution<>(INT32_MIN, - INT32_MAX)) {} + m_gen(m_rng,boost::random::uniform_int_distribution<>(std::numeric_limits::min(), + std::numeric_limits::max())) {} connection_ptr connect(const std::string& u); From 57630721f6bc4989cf17ec036e3e01f0d22ac427 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Thu, 8 Mar 2012 17:09:25 +0100 Subject: [PATCH 5/7] fix newlines at file ends, more aggressive optim. --- SConstruct | 6 ++---- examples/wsperf/case.cpp | 2 +- examples/wsperf/case.hpp | 2 +- examples/wsperf/generic.cpp | 2 +- examples/wsperf/generic.hpp | 2 +- examples/wsperf/request.cpp | 2 +- examples/wsperf/request.hpp | 9 +-------- src/uri.cpp | 2 +- 8 files changed, 9 insertions(+), 18 deletions(-) diff --git a/SConstruct b/SConstruct index 606ad855ea..bfc6f83f1d 100644 --- a/SConstruct +++ b/SConstruct @@ -54,10 +54,8 @@ if env['PLATFORM'].startswith('win'): env['LINKFLAGS'] = '/INCREMENTAL:NO /MANIFEST /NOLOGO /OPT:REF /OPT:ICF /MACHINE:X86' elif env['PLATFORM'] == 'posix': env.Append(CPPDEFINES = ['NDEBUG']) - arch_flags = '' - opt_flags = '-O2' - warn_flags = '-Wall' - env['CCFLAGS'] = '%s %s %s' % (warn_flags, arch_flags, opt_flags) + env.Append(CCFLAGS = ['-Wall', '-fno-strict-aliasing']) + env.Append(CCFLAGS = ['-O3', '-fomit-frame-pointer', '-march=core2']) #env['LINKFLAGS'] = '' diff --git a/examples/wsperf/case.cpp b/examples/wsperf/case.cpp index 1156347606..65d401e974 100644 --- a/examples/wsperf/case.cpp +++ b/examples/wsperf/case.cpp @@ -23,4 +23,4 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - */ \ No newline at end of file + */ diff --git a/examples/wsperf/case.hpp b/examples/wsperf/case.hpp index 7b7d7c7779..4926ff74ae 100644 --- a/examples/wsperf/case.hpp +++ b/examples/wsperf/case.hpp @@ -316,4 +316,4 @@ typedef boost::shared_ptr case_handler_ptr; } // namespace wsperf -#endif // WSPERF_CASE_HPP \ No newline at end of file +#endif // WSPERF_CASE_HPP diff --git a/examples/wsperf/generic.cpp b/examples/wsperf/generic.cpp index 1156347606..65d401e974 100644 --- a/examples/wsperf/generic.cpp +++ b/examples/wsperf/generic.cpp @@ -23,4 +23,4 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - */ \ No newline at end of file + */ diff --git a/examples/wsperf/generic.hpp b/examples/wsperf/generic.hpp index 88ab45d4c1..534f3e9773 100644 --- a/examples/wsperf/generic.hpp +++ b/examples/wsperf/generic.hpp @@ -158,4 +158,4 @@ private: } // namespace wsperf -#endif // WSPERF_CASE_GENERIC_HPP \ No newline at end of file +#endif // WSPERF_CASE_GENERIC_HPP diff --git a/examples/wsperf/request.cpp b/examples/wsperf/request.cpp index 1156347606..65d401e974 100644 --- a/examples/wsperf/request.cpp +++ b/examples/wsperf/request.cpp @@ -23,4 +23,4 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - */ \ No newline at end of file + */ diff --git a/examples/wsperf/request.hpp b/examples/wsperf/request.hpp index c9c5815318..f1484cae54 100644 --- a/examples/wsperf/request.hpp +++ b/examples/wsperf/request.hpp @@ -188,11 +188,4 @@ void process_requests(request_coordinator* coordinator) { } // namespace wsperf - - - - - - - -#endif // WSPERF_REQUEST_HPP \ No newline at end of file +#endif // WSPERF_REQUEST_HPP diff --git a/src/uri.cpp b/src/uri.cpp index c1cb3151ae..b69ab6bb71 100644 --- a/src/uri.cpp +++ b/src/uri.cpp @@ -317,4 +317,4 @@ uint16_t uri::get_port_from_string(const std::string& port) const { } return t_port; -} \ No newline at end of file +} From ae2dac32f0b7289b9c95b3ba7c541ad853fd1418 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Thu, 8 Mar 2012 17:15:37 +0100 Subject: [PATCH 6/7] make away warn --- SConstruct | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index bfc6f83f1d..f17d9d9d2e 100644 --- a/SConstruct +++ b/SConstruct @@ -44,9 +44,13 @@ def boostlibs(libnames): libs.append(lib) return libs - if env['PLATFORM'].startswith('win'): - env.Append(CPPDEFINES = ['WIN32', 'NDEBUG', '_CONSOLE', '_WEBSOCKETPP_CPP11_FRIEND_']) + env.Append(CPPDEFINES = ['WIN32', + 'NDEBUG', + 'WIN32_LEAN_AND_MEAN', + '_WIN32_WINNT=0x0600', + '_CONSOLE', + '_WEBSOCKETPP_CPP11_FRIEND_']) arch_flags = '/arch:SSE2' opt_flags = '/Ox /Oi /fp:fast' warn_flags = '/W3 /wd4996 /wd4995 /wd4355' From 16a4ba98b43da9341e1b47e74181f273a904f7c5 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Thu, 8 Mar 2012 17:55:13 +0100 Subject: [PATCH 7/7] refactor build for tree of scons makefiles, fix out of source build, correct target handling --- .gitignore | 2 +- SConstruct | 74 +++++++++++---------------------- examples/echo_server/SConscript | 20 +++++++++ examples/wsperf/SConscript | 26 ++++++++++++ src/SConscript | 19 +++++++++ 5 files changed, 91 insertions(+), 50 deletions(-) create mode 100644 examples/echo_server/SConscript create mode 100644 examples/wsperf/SConscript create mode 100644 src/SConscript diff --git a/.gitignore b/.gitignore index a8d338edf7..14928e0e84 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ examples/wsperf/wsperf .sconsign.dblite -release/ \ No newline at end of file +build/ \ No newline at end of file diff --git a/SConstruct b/SConstruct index f17d9d9d2e..1dbf72d0dc 100644 --- a/SConstruct +++ b/SConstruct @@ -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) diff --git a/examples/echo_server/SConscript b/examples/echo_server/SConscript new file mode 100644 index 0000000000..f65aa91ab2 --- /dev/null +++ b/examples/echo_server/SConscript @@ -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') diff --git a/examples/wsperf/SConscript b/examples/wsperf/SConscript new file mode 100644 index 0000000000..7bc172397c --- /dev/null +++ b/examples/wsperf/SConscript @@ -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') diff --git a/src/SConscript b/src/SConscript new file mode 100644 index 0000000000..00fcfea756 --- /dev/null +++ b/src/SConscript @@ -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')