Browse Source

Allow mixing debug version of evmjit with release version of LLVM library

cl-refactor
Paweł Bylica 10 years ago
parent
commit
6d6256f83b
  1. 1
      evmjit/libevmjit/BuildInfo.h.in
  2. 2
      evmjit/libevmjit/CMakeLists.txt
  3. 6
      evmjit/libevmjit/Utils.cpp

1
evmjit/libevmjit/BuildInfo.h.in

@ -8,3 +8,4 @@
#define LLVM_VERSION "${LLVM_PACKAGE_VERSION}"
#define LLVM_ASSERTIONS "${LLVM_ENABLE_ASSERTIONS}"
#define LLVM_DEBUG ${LLVM_DEBUG}

2
evmjit/libevmjit/CMakeLists.txt

@ -48,6 +48,8 @@ else()
set(EVMJIT_SOVERSION ${EVMJIT_VERSION_MAJOR})
endif()
string(COMPARE EQUAL "${LLVM_ENABLE_ASSERTIONS}" "ON" LLVM_DEBUG)
configure_file(BuildInfo.h.in ${CMAKE_CURRENT_BINARY_DIR}/gen/BuildInfo.gen.h)
message(STATUS "EVM JIT version: ${EVMJIT_VERSION_MAJOR}.${EVMJIT_VERSION_MINOR}.${EVMJIT_VERSION_PATCH} ${EVMJIT_VERSION_PRERELEASE} (${EVMJIT_VERSION_FULL})")

6
evmjit/libevmjit/Utils.cpp

@ -2,6 +2,8 @@
#include <llvm/Support/Debug.h>
#include "BuildInfo.gen.h"
#if !defined(NDEBUG) // Debug
namespace dev
@ -12,7 +14,11 @@ namespace evmjit
std::ostream& getLogStream(char const* _channel)
{
static std::ostream nullStream{nullptr};
#if LLVM_DEBUG
return (llvm::DebugFlag && llvm::isCurrentDebugType(_channel)) ? std::cerr : nullStream;
#else
return (void)_channel, nullStream;
#endif
}
}

Loading…
Cancel
Save