mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improved SConstruct:
* Automatic source list built via directory iteration
* Build multiple toolchains and flavors simulaneously:
- Toolchains: gcc, clang, msvc
- Flavors: debug, release
* Documentation on aliases (top of the SConstruct file)
This commit is contained in:
@@ -24,8 +24,6 @@ import SCons.Node
|
||||
import SCons.Script.Main
|
||||
import SCons.Util
|
||||
|
||||
import sys
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Adapted from msvs.py
|
||||
@@ -102,7 +100,7 @@ def itemList(items, sep):
|
||||
def gen():
|
||||
for item in sorted(items):
|
||||
if type(item) == dict:
|
||||
for k, v in item.items():
|
||||
for k, v in sorted(item.items()):
|
||||
yield k + '=' + v
|
||||
else:
|
||||
yield item
|
||||
@@ -141,7 +139,6 @@ class SwitchConverter(object):
|
||||
tag = 'AdditionalOptions'
|
||||
xml.append('%(prefix)s<%(tag)s>%(s)s%%(%(tag)s)</%(tag)s>\r\n' % locals())
|
||||
if xml:
|
||||
xml.sort()
|
||||
return ''.join(xml)
|
||||
return ''
|
||||
|
||||
@@ -562,13 +559,6 @@ class _ProjectGenerator(object):
|
||||
self.filters_node = filters_node
|
||||
self.filters_file = None
|
||||
self.guid = _guid(os.path.basename(str(self.project_node)))
|
||||
self.cpppath = []
|
||||
for path in [os.path.abspath(x) for x in makeList(env['CPPPATH'])]:
|
||||
common = os.path.commonprefix([path, self.root_dir])
|
||||
if len(common) == len(self.root_dir):
|
||||
self.cpppath.append(winpath(os.path.relpath(path, self.project_dir)))
|
||||
#else:
|
||||
# self.cpppath.append(path)
|
||||
self.buildItemList(env)
|
||||
|
||||
def buildItemList(self, env):
|
||||
@@ -596,7 +586,7 @@ class _ProjectGenerator(object):
|
||||
targets = config.target
|
||||
for target in targets:
|
||||
_walk(target, items)
|
||||
self.items = sorted([v for k, v in items.iteritems()], key=lambda x: x.path)
|
||||
self.items = sorted(items.itervalues(), key=lambda x: x.path)
|
||||
|
||||
def makeListTag(self, items, tag, prefix='', inherit=True):
|
||||
'''Builds an XML tag string from a list of items. If items is
|
||||
@@ -615,42 +605,25 @@ class _ProjectGenerator(object):
|
||||
for path in paths:
|
||||
if not os.path.isabs(path):
|
||||
items.append(winpath(os.path.relpath(path, self.project_dir)))
|
||||
items.sort()
|
||||
return items
|
||||
|
||||
def makePaths(self, paths, extra = None):
|
||||
'''Returns a semicolon delimited string formed from a list
|
||||
of root relative paths converted to be project relative.'''
|
||||
s = ''
|
||||
sep = ''
|
||||
root_dir = os.getcwd()
|
||||
for path in sorted(paths):
|
||||
common = os.path.commonprefix([os.path.abspath(path), root_dir])
|
||||
if len(common) == len(root_dir):
|
||||
s += sep
|
||||
s += winpath(os.path.relpath(path, self.project_dir))
|
||||
sep = ';'
|
||||
if extra:
|
||||
s += sep + extra
|
||||
return s
|
||||
|
||||
def writeHeader(self):
|
||||
global clSwitches
|
||||
|
||||
encoding = 'utf-8'
|
||||
project_guid = self.guid
|
||||
name = 'RippleD'
|
||||
name = os.path.splitext(os.path.basename(str(self.project_node)))[0]
|
||||
|
||||
f = self.project_file
|
||||
f.write(UnicodeByteMarker)
|
||||
f.write(V12DSPHeader % locals())
|
||||
f.write(V12DSPGlobals % locals())
|
||||
f.write(' <ItemGroup Label="ProjectConfigurations">\r\n')
|
||||
for config in self.configs:
|
||||
variant = config.variant
|
||||
platform = config.platform
|
||||
f.write(V12DSPProjectConfiguration % locals())
|
||||
f.write(' </ItemGroup>\r\n')
|
||||
f.write(V12DSPGlobals % locals())
|
||||
|
||||
f.write(' <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r\n')
|
||||
for config in self.configs:
|
||||
@@ -678,26 +651,23 @@ class _ProjectGenerator(object):
|
||||
# Cl options
|
||||
f.write(' <ClCompile>\r\n')
|
||||
f.write(
|
||||
#' <PrecompiledHeader />\r\n'
|
||||
' <PreprocessorDefinitions>%s%%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n' % (
|
||||
itemList(config.env['CPPDEFINES'], ';')))
|
||||
props = ''
|
||||
props += self.makeListTag(
|
||||
[x for x in config.env['CPPPATH'] if is_subdir(x, self.root_dir)
|
||||
], 'AdditionalIncludeDirectories', ' ', True)
|
||||
props += self.makeListTag(self.relPaths(sorted(config.env['CPPPATH'])),
|
||||
'AdditionalIncludeDirectories', ' ', True)
|
||||
f.write(props)
|
||||
f.write(CLSWITCHES.getXml(config.env['CCFLAGS'], ' '))
|
||||
f.write(CLSWITCHES.getXml(sorted(config.env['CCFLAGS']), ' '))
|
||||
f.write(' </ClCompile>\r\n')
|
||||
|
||||
f.write(' <Link>\r\n')
|
||||
props = ''
|
||||
props += self.makeListTag([x for x in config.env['LIBS']
|
||||
], 'AdditionalDependencies', ' ', True)
|
||||
props += self.makeListTag(
|
||||
[x for x in config.env['LIBPATH'] if is_subdir(x, self.root_dir)
|
||||
], 'AdditionalLibraryDirectories', ' ', True)
|
||||
props += self.makeListTag(sorted(config.env['LIBS']),
|
||||
'AdditionalDependencies', ' ', True)
|
||||
props += self.makeListTag(self.relPaths(sorted(config.env['LIBPATH'])),
|
||||
'AdditionalLibraryDirectories', ' ', True)
|
||||
f.write(props)
|
||||
f.write(LINKSWITCHES.getXml(config.env['LINKFLAGS'], ' '))
|
||||
f.write(LINKSWITCHES.getXml(sorted(config.env['LINKFLAGS']), ' '))
|
||||
f.write(' </Link>\r\n')
|
||||
|
||||
f.write(' </ItemDefinitionGroup>\r\n')
|
||||
@@ -715,14 +685,13 @@ class _ProjectGenerator(object):
|
||||
props = ' <ExcludedFromBuild>True</ExcludedFromBuild>\r\n'
|
||||
elif item.builder() == 'Object':
|
||||
props = ''
|
||||
for config, output in item.node.iteritems():
|
||||
for config, output in sorted(item.node.iteritems()):
|
||||
name = config.name
|
||||
env = output.get_build_env()
|
||||
inc_dirs = self.makePaths(env['CPPPATH'])
|
||||
props += self.makeListTag(self.relPaths(env['CPPPATH']),
|
||||
props += self.makeListTag(self.relPaths(sorted(env['CPPPATH'])),
|
||||
'AdditionalIncludeDirectories', ' ', True)
|
||||
elif item.builder() == 'Protoc':
|
||||
for config, output in item.node.iteritems():
|
||||
for config, output in sorted(item.node.iteritems()):
|
||||
name = config.name
|
||||
out_dir = os.path.relpath(os.path.dirname(str(output)), self.project_dir)
|
||||
cpp_out = winpath(out_dir)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#if ! BEAST_COMPILE_OBJECTIVE_CPP
|
||||
|
||||
/* This file includes all of the beast sources needed to link.
|
||||
By including them here, we avoid having to muck with the SConstruct
|
||||
Makefile, Project file, or whatever.
|
||||
@@ -46,3 +48,5 @@
|
||||
#include "../../beast/beast/cxx14/cxx14.unity.cpp"
|
||||
|
||||
#include "../../beast/beast/unit_test/define_print.cpp"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,4 +17,11 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "ripple_beast.cpp"
|
||||
#if ! BEAST_COMPILE_OBJECTIVE_CPP
|
||||
#error Incorrect compilation setting!
|
||||
#endif
|
||||
|
||||
#undef BEAST_COMPILE_OBJECTIVE_CPP
|
||||
#define BEAST_COMPILE_OBJECTIVE_CPP 0
|
||||
|
||||
#include "ripple_beast.unity.cpp"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "ripple_http.h"
|
||||
|
||||
#include "../ripple_net/ripple_net.h"
|
||||
#include "../../ripple_net/ripple_net.h"
|
||||
|
||||
#include "../../beast/modules/beast_core/system/BeforeBoost.h"
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
4
src/ripple/proto/.gitignore
vendored
4
src/ripple/proto/.gitignore
vendored
@@ -1,4 +0,0 @@
|
||||
# These files are generated by protoc and should not be part of the repository.
|
||||
|
||||
*.pb.cc
|
||||
*.pb.h
|
||||
4
src/ripple/proto/README.md
Normal file
4
src/ripple/proto/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Proto
|
||||
|
||||
This holds protocol buffers source code. The protoc tool stores the output
|
||||
of the .proto files in the build directory.
|
||||
@@ -1,7 +1,8 @@
|
||||
|
||||
// Unity build file for libprotobuf by Vinnie Falco <vinnie.falco@gmail.com>
|
||||
//
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#ifdef _MSC_VER // MSVC
|
||||
# pragma warning (push)
|
||||
# pragma warning (disable: 4018) // signed/unsigned mismatch
|
||||
@@ -52,3 +53,5 @@
|
||||
#ifdef _MSC_VER // MSVC
|
||||
# pragma warning (pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
20
src/ripple/proto/ripple_proto.unity.cpp
Normal file
20
src/ripple/proto/ripple_proto.unity.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2014 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "ripple.pb.cc"
|
||||
@@ -17,9 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../ripple/common/seconds_clock.h"
|
||||
#include "../ripple_rpc/api/Manager.h"
|
||||
#include "../ripple_overlay/api/make_Overlay.h"
|
||||
#include "../../ripple/common/seconds_clock.h"
|
||||
#include "../../ripple_rpc/api/Manager.h"
|
||||
#include "../../ripple_overlay/api/make_Overlay.h"
|
||||
|
||||
#include "Tuning.h"
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#ifndef RIPPLE_FULLBELOWCACHE_H_INCLUDED
|
||||
#define RIPPLE_FULLBELOWCACHE_H_INCLUDED
|
||||
|
||||
#include "../ripple/types/api/base_uint.h"
|
||||
#include "../ripple/radmap/api/BasicFullBelowCache.h"
|
||||
#include "../../ripple/types/api/base_uint.h"
|
||||
#include "../../ripple/radmap/api/BasicFullBelowCache.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
#ifndef RIPPLE_SHAMAP_H
|
||||
#define RIPPLE_SHAMAP_H
|
||||
|
||||
#include "../ripple/radmap/ripple_radmap.h"
|
||||
#include "../main/FullBelowCache.h"
|
||||
|
||||
#include "../../ripple/radmap/ripple_radmap.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace std {
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
#include <vector>
|
||||
|
||||
// backend support
|
||||
#include "../ripple_hyperleveldb/ripple_hyperleveldb.h"
|
||||
#include "../ripple_leveldb/ripple_leveldb.h"
|
||||
#include "../ripple/rocksdb/ripple_rocksdb.h"
|
||||
#include "../../ripple_hyperleveldb/ripple_hyperleveldb.h"
|
||||
#include "../../ripple_leveldb/ripple_leveldb.h"
|
||||
#include "../../ripple/rocksdb/ripple_rocksdb.h"
|
||||
|
||||
#include "../beast/beast/cxx14/memory.h"
|
||||
#include "../../beast/beast/cxx14/memory.h"
|
||||
|
||||
#include "../../ripple/common/seconds_clock.h"
|
||||
#include "../../ripple/common/TaggedCache.h"
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
#include "../crypto/Base58Data.h"
|
||||
|
||||
#include "../ripple/types/api/UInt160.h"
|
||||
#include "../ripple/types/api/RippleAccountID.h"
|
||||
#include "../ripple/types/api/RippleAccountPrivateKey.h"
|
||||
#include "../ripple/types/api/RippleAccountPublicKey.h"
|
||||
#include "../ripple/types/api/RipplePrivateKey.h"
|
||||
#include "../ripple/types/api/RipplePublicKey.h"
|
||||
#include "../ripple/types/api/RipplePublicKeyHash.h"
|
||||
#include "../ripple/sslutil/api/ECDSACanonical.h"
|
||||
#include "../../ripple/types/api/UInt160.h"
|
||||
#include "../../ripple/types/api/RippleAccountID.h"
|
||||
#include "../../ripple/types/api/RippleAccountPrivateKey.h"
|
||||
#include "../../ripple/types/api/RippleAccountPublicKey.h"
|
||||
#include "../../ripple/types/api/RipplePrivateKey.h"
|
||||
#include "../../ripple/types/api/RipplePublicKey.h"
|
||||
#include "../../ripple/types/api/RipplePublicKeyHash.h"
|
||||
#include "../../ripple/sslutil/api/ECDSACanonical.h"
|
||||
|
||||
namespace ripple {
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <boost/unordered_set.hpp> // For InfoSub
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER /**/
|
||||
#include <boost/asio/ssl.hpp>
|
||||
|
||||
#include "../ripple/resource/ripple_resource.h"
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
@ingroup ripple_net
|
||||
*/
|
||||
|
||||
#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER /**/
|
||||
|
||||
#include "../../BeastConfig.h"
|
||||
|
||||
#include "../beast/modules/beast_core/system/BeforeBoost.h"
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
#ifndef RIPPLE_OVERLAY_MESSAGE_H_INCLUDED
|
||||
#define RIPPLE_OVERLAY_MESSAGE_H_INCLUDED
|
||||
|
||||
#include "../../ripple/proto/ripple.pb.h"
|
||||
#include "ripple.pb.h"
|
||||
|
||||
#include "../../beast/modules/beast_core/system/BeforeBoost.h"
|
||||
|
||||
#include "../beast/modules/beast_core/system/BeforeBoost.h"
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
|
||||
#include "../../ripple/common/MultiSocket.h"
|
||||
#include "../../ripple_data/protocol/Protocol.h"
|
||||
#include "../ripple/validators/ripple_validators.h"
|
||||
#include "../ripple/peerfinder/ripple_peerfinder.h"
|
||||
#include "../ripple_app/misc/ProofOfWork.h"
|
||||
#include "../ripple_app/misc/ProofOfWorkFactory.h"
|
||||
#include "../../ripple/validators/ripple_validators.h"
|
||||
#include "../../ripple/peerfinder/ripple_peerfinder.h"
|
||||
#include "../../ripple_app/misc/ProofOfWork.h"
|
||||
#include "../../ripple_app/misc/ProofOfWorkFactory.h"
|
||||
|
||||
// VFALCO This is unfortunate. Comment this out and
|
||||
// just include what is needed.
|
||||
#include "../ripple_app/ripple_app.h"
|
||||
#include "../../ripple_app/ripple_app.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#ifndef RIPPLE_RPC_REQUEST_H_INCLUDED
|
||||
#define RIPPLE_RPC_REQUEST_H_INCLUDED
|
||||
|
||||
#include "../ripple/json/ripple_json.h"
|
||||
#include "../ripple/resource/ripple_resource.h"
|
||||
#include "../../ripple/json/ripple_json.h"
|
||||
#include "../../ripple/resource/ripple_resource.h"
|
||||
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../beast/beast/cxx14/memory.h"
|
||||
#include "../../beast/beast/cxx14/memory.h"
|
||||
|
||||
#include "../api/Manager.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user