set(TAGLIB_WITH_MP4 TRUE)
endif()
+option(TRACE_IN_RELEASE "Output debug messages even in release mode" OFF)
+if(TRACE_IN_RELEASE)
+ set(TAGLIB_TRACE_IN_RELEASE TRUE)
+endif()
+
configure_file(taglib/taglib_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_config.h)
add_subdirectory(taglib)
#define TAGLIB_WITH_ASF 1
#define TAGLIB_WITH_MP4 1
+#cmakedefine TAGLIB_TRACE_IN_RELEASE 1
***************************************************************************/
#include "config.h"
+#include "taglib_config.h"
#include "tdebug.h"
#include "tstring.h"
void TagLib::debug(const String &s)
{
+#if !defined(NDEBUG) || defined(TAGLIB_TRACE_IN_RELEASE)
+
getDebugListener()->printMessage("TagLib: " + s + "\n");
+
+#endif
}
void TagLib::debugData(const ByteVector &v)
{
+#if !defined(NDEBUG) || defined(TAGLIB_TRACE_IN_RELEASE)
+
for(size_t i = 0; i < v.size(); ++i)
{
String msg
getDebugListener()->printMessage(msg);
}
+
+#endif
}
#include "tdebuglistener.h"
-#ifndef NDEBUG
-# include <iostream>
-# include <bitset>
-# ifdef _WIN32
-# include <windows.h>
-# endif
+#include <iostream>
+#include <bitset>
+
+#ifdef _WIN32
+# include <windows.h>
#endif
using namespace TagLib;
public:
virtual void printMessage(const String &msg)
{
-#ifndef NDEBUG
-# ifdef _WIN32
+#ifdef _WIN32
const wstring wstr = msg.toWString();
const int len = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, NULL, 0, NULL, NULL);
std::cerr << std::string(&buf[0]);
}
-
-# else
+#else
std::cerr << msg;
-# endif
-#endif
+#endif
}
};