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)
if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
endif()
# options
include(cmake/Option.cmake)

View File

@ -26,6 +26,16 @@ SINGLE_QUOTE := '
OPEN_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
ifeq ($(OS),Windows_NT)
@ -124,7 +134,7 @@ ifeq ($(HOST_OS),Win)
CC := cl
CXX := cl
MAKE := make
BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=Release
BUILD := msbuild.exe ALL_BUILD.vcxproj /property:Configuration=$(BUILD_TYPE)
endif
else
# mac & linux
@ -144,8 +154,7 @@ endif
# CMake
CMAKE := cmake
# CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Debug
CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=Release
CMAKE := $(CMAKE) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
ifneq ($(CC),)
CMAKE := $(CMAKE) -DCMAKE_C_COMPILER=$(CC)
endif

View File

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

View File

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