Avoid generation of the backtrace.hpp entirely.

This commit is contained in:
Marcus Edel
2015-03-25 21:14:27 +01:00
parent 73b48dd8d3
commit aaa17fc7f5
5 changed files with 8 additions and 36 deletions
-15
View File
@@ -1,15 +0,0 @@
/**
* @file backtrace.hpp
*
* Configuration file that includes backtrace headers (if they exist on this
* system), auto-generated by CMake.
*/
#ifndef __MLPACK_CORE_UTIL_BACKTRACE_HPP
#define __MLPACK_CORE_UTIL_BACKTRACE_HPP
#cmakedefine01 Backtrace_FOUND
#if Backtrace_FOUND
#include <@Backtrace_HEADER@>
#endif
#endif
+2 -4
View File
@@ -65,12 +65,10 @@ endif(CMAKE_COMPILER_IS_GNUCC AND PROFILE)
find_package(Backtrace)
if(Backtrace_FOUND)
include_directories(${Backtrace_INCLUDE_DIRS})
add_definitions(-DBACKTRACE_FOUND)
add_definitions(-DBACKTRACE_HEADER="${Backtrace_HEADER}")
endif(Backtrace_FOUND)
# Generate the backtrace header file.
configure_file(${CMAKE_MODULE_PATH}/backtrace.h.in
${CMAKE_SOURCE_DIR}/src/mlpack/core/util/backtrace.hpp)
# If the user asked for running test cases with verbose output, turn that on.
if(TEST_VERBOSE)
add_definitions(-DTEST_VERBOSE)
-12
View File
@@ -1,12 +0,0 @@
/**
* @file backtrace.hpp
*
* Default configuration file to include backtrace() functionality. Here we
* assume it is not available.
*/
#ifndef __MLPACK_CORE_UTIL_BACKTRACE_HPP
#define __MLPACK_CORE_UTIL_BACKTRACE_HPP
#define Backtrace_FOUND 0
#endif
+6 -3
View File
@@ -10,7 +10,10 @@
#endif
#include "log.hpp"
#include "backtrace.hpp"
#ifdef BACKTRACE_FOUND
#include BACKTRACE_HEADER
#endif
// Color code escape sequences -- but not on Windows.
#ifndef _WIN32
@@ -53,7 +56,7 @@ void Log::Assert(bool condition, const std::string& message)
{
if (!condition)
{
#if Backtrace_FOUND
#ifdef BACKTRACE_FOUND
void* array[25];
size_t size = backtrace(array, sizeof(array) / sizeof(void*));
char** messages = backtrace_symbols(array, size);
@@ -118,7 +121,7 @@ void Log::Assert(bool condition, const std::string& message)
#endif
Log::Debug << message << std::endl;
#if Backtrace_FOUND
#ifdef BACKTRACE_FOUND
free(messages);
#endif
-2
View File
@@ -10,8 +10,6 @@
#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"
#include <mlpack/core/util/backtrace.hpp>
using namespace mlpack;
BOOST_AUTO_TEST_SUITE(LogTest);