Support debug build

This commit is contained in:
John Zhao 2018-11-01 20:42:44 +08:00
parent d443029599
commit f923414660
4 changed files with 26 additions and 6 deletions

View File

@ -18,6 +18,10 @@ project(mynteye VERSION 2.2.1 LANGUAGES C CXX)
include(cmake/Common.cmake) include(cmake/Common.cmake)
if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
endif()
# options # options
include(cmake/Option.cmake) include(cmake/Option.cmake)

View File

@ -26,6 +26,16 @@ SINGLE_QUOTE := '
OPEN_PAREN := ( OPEN_PAREN := (
CLOSE_PAREN := ) CLOSE_PAREN := )
# Options
#
# VS_CODE: ignore to auto detect, otherwise specify the version
# 15|2017, 14|2015, 12|2013, 11|2012, 10|2010, 9|2008, 8|2005
# BUILD_TYPE: Debug|Release
#
# e.g. make [TARGET] VS_CODE=2017 BUILD_TYPE=Debug
BUILD_TYPE ?= Release
# Host detection # Host detection
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
@ -124,7 +134,7 @@ ifeq ($(HOST_OS),Win)
CC := cl CC := cl
CXX := cl CXX := cl
MAKE := make MAKE := make
BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=Release BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=$(BUILD_TYPE)
endif endif
else else
# mac & linux # mac & linux
@ -144,8 +154,7 @@ endif
# CMake # CMake
CMAKE := cmake CMAKE := cmake
# CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Debug CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Release
ifneq ($(CC),) ifneq ($(CC),)
CMAKE := $(CMAKE) -DCMAKE_C_COMPILER=$(CC) CMAKE := $(CMAKE) -DCMAKE_C_COMPILER=$(CC)
endif endif

View File

@ -15,7 +15,6 @@
#define MYNTEYE_DEVICE_DEVICE_H_ #define MYNTEYE_DEVICE_DEVICE_H_
#pragma once #pragma once
#include <limits>
#include <map> #include <map>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
@ -245,8 +244,11 @@ class MYNTEYE_API Device {
/** /**
* Enable cache motion datas. * Enable cache motion datas.
*/ */
void EnableMotionDatas( void EnableMotionDatas();
std::size_t max_size = std::numeric_limits<std::size_t>::max()); /**
* Enable cache motion datas.
*/
void EnableMotionDatas(std::size_t max_size);
/** /**
* Get the motion datas. * Get the motion datas.
*/ */

View File

@ -15,6 +15,7 @@
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <limits>
#include <stdexcept> #include <stdexcept>
#include <utility> #include <utility>
@ -415,6 +416,10 @@ device::StreamData Device::GetLatestStreamData(const Stream &stream) {
return streams_->GetLatestStreamData(stream); return streams_->GetLatestStreamData(stream);
} }
void Device::EnableMotionDatas() {
EnableMotionDatas(std::numeric_limits<std::size_t>::max());
}
void Device::EnableMotionDatas(std::size_t max_size) { void Device::EnableMotionDatas(std::size_t max_size) {
CHECK_NOTNULL(motions_); CHECK_NOTNULL(motions_);
motions_->EnableMotionDatas(max_size); motions_->EnableMotionDatas(max_size);