diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index cfd9a38ace..93d6463305 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -3225,6 +3225,10 @@ + + + + ..\..\src\hyperleveldb;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories) ..\..\src\hyperleveldb;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories) diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index 4683f393bc..166ab1bc80 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -4389,6 +4389,12 @@ ripple\unity + + ripple\unity + + + ripple\unity + ripple\unity diff --git a/SConstruct b/SConstruct index de59a8100e..3149bbf5f4 100644 --- a/SConstruct +++ b/SConstruct @@ -340,12 +340,6 @@ def config_env(toolchain, variant, env): '-fno-strict-aliasing' ]) - if toolchain != 'msvc': - git = Beast.Git(env) - if git.exists: - id = '%s+%s.%s' % (git.tags, git.user, git.branch) - env.Append(CPPDEFINES={'GIT_COMMIT_ID' : '\'"%s"\'' % id }) - if toolchain == 'clang': if Beast.system.osx: env.Replace(CC='clang', CXX='clang++', LINK='clang++') @@ -625,14 +619,27 @@ for tu_style in ['classic', 'unity']: 'src/ripple/unity/protocol.cpp', 'src/ripple/unity/shamap.cpp', ) + object_builder.add_source_files( 'src/ripple/unity/nodestore.cpp', CPPPATH=[ - 'src/leveldb/include', + 'src/leveldb/include', #'src/hyperleveldb/include', # hyper 'src/rocksdb2/include', ]) + git_commit_tag = {} + if toolchain != 'msvc': + git = Beast.Git(env) + if git.exists: + id = '%s+%s.%s' % (git.tags, git.user, git.branch) + git_commit_tag = {'CPPDEFINES': + {'GIT_COMMIT_ID' : '\'"%s"\'' % id }} + + object_builder.add_source_files( + 'src/ripple/unity/git_id.cpp', + **git_commit_tag) + object_builder.add_source_files( 'src/ripple/unity/beast.cpp', 'src/ripple/unity/protobuf.cpp', diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index e563582c55..a21faa6989 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -782,11 +783,7 @@ public: void onStart () { -#ifdef GIT_COMMIT_ID - m_journal.info << "Application starting. Build is " << GIT_COMMIT_ID; -#else - m_journal.info << "Application starting."; -#endif + m_journal.info << "Application starting. Build is " << gitCommitID(); m_sweepTimer.setExpiration (10); diff --git a/src/ripple/unity/git_id.cpp b/src/ripple/unity/git_id.cpp new file mode 100644 index 0000000000..04575a26cb --- /dev/null +++ b/src/ripple/unity/git_id.cpp @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2012, 2013 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 + +namespace ripple { + +std::string gitCommitID() { +#if defined(GIT_COMMIT_ID) + return GIT_COMMIT_ID; +#else + return std::string(); +#endif +} + +} diff --git a/src/ripple/unity/git_id.h b/src/ripple/unity/git_id.h new file mode 100644 index 0000000000..ec383ef262 --- /dev/null +++ b/src/ripple/unity/git_id.h @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2012, 2013 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. +*/ +//============================================================================== + +#ifndef RIPPLE_GIT_TAG_H_INCLUDED +#define RIPPLE_GIT_TAG_H_INCLUDED + +#include + +namespace ripple { + +/** Get the git commit id from the git repo from which this was compiled. */ +std::string gitCommitID(); + +} + +#endif