Skip to content

Commit

Permalink
Merge pull request #32 from mbientlab/win_reintro
Browse files Browse the repository at this point in the history
win10: restore build files and support.
  • Loading branch information
lkasso authored Dec 22, 2021
2 parents 1c9bfed + b9e08f8 commit b997e7b
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "MetaWear C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.20.6
PROJECT_NUMBER = 0.20.7

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
101 changes: 101 additions & 0 deletions MetaWear.Win32.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{779F1B32-5465-416E-B14F-3F5256644E5F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>MetaWear.Win32</ProjectName>
<RootNamespace>MetaWear.Win32</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup>
<OutDir>dist\$(Configuration)\lib\$(Platform)\</OutDir>
<IntermediateOutputPath>build\$(Platform)\$(Configuration)\$(ProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries Condition="'$(Configuration)'=='Debug'">true</UseDebugLibraries>
<UseDebugLibraries Condition="'$(Configuration)'=='Release'">false</UseDebugLibraries>
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<LinkIncremental Condition="'$(Configuration)'=='Debug'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)'=='Release'">false</LinkIncremental>
<IncludePath>$(MSBuildProjectDirectory)\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization Condition="'$(Configuration)'=='Debug'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)'=='Release'">MaxSpeed</Optimization>
<FunctionLevelLinking Condition="'$(Configuration)'=='Release'">true</FunctionLevelLinking>
<IntrinsicFunctions Condition="'$(Configuration)'=='Release'">true</IntrinsicFunctions>
<PreprocessorDefinitions>METAWEAR_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding Condition="'$(Configuration)'=='Release'">true</EnableCOMDATFolding>
<OptimizeReferences Condition="'$(Configuration)'=='Release'">true</OptimizeReferences>
<GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="src\metawear\**\cpp\*.h" />
<ClInclude Include="src\metawear\**\*.h" />
<ClCompile Include="src\metawear\core\**\*.cpp" />
<ClCompile Include="src\metawear\dfu\**\*.cpp" />
<ClCompile Include="src\metawear\impl\**\*.cpp" />
<ClCompile Include="src\metawear\peripheral\**\*.cpp" />
<ClCompile Include="src\metawear\platform\**\*.cpp" />
<ClCompile Include="src\metawear\processor\**\*.cpp" />
<ClCompile Include="src\metawear\sensor\**\*.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<UsingTask TaskName="SetEnv" AssemblyFile="$(MSBuildThisFileDirectory)Microsoft.Build.CppTasks.Common.dll"/>
<Target Name="Test" DependsOnTargets="Build">
<SetEnv Name ="METAWEAR_LIB_SO_NAME"
Value ="$(TargetPath)"
Prefix ="false">
</SetEnv>

<SetEnv Name ="PYTHONPATH"
Value ="bindings\python"
Prefix ="false">
</SetEnv>
<Exec Command="python -m unittest discover -s test" />
</Target>
</Project>
96 changes: 96 additions & 0 deletions MetaWear.WinRT.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6fcc44f2-ee6e-4ad1-9442-e35a935fe628}</ProjectGuid>
<Keyword>WindowsRuntimeComponent</Keyword>
<ProjectName>MetaWear.WinRT</ProjectName>
<RootNamespace>MetaWear.WinRT</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<PropertyGroup>
<OutDir>dist\$(Configuration)\lib\$(Platform)\</OutDir>
<IntermediateOutputPath>build\$(Platform)\$(Configuration)\$(ProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries Condition="'$(Configuration)'=='Debug'">true</UseDebugLibraries>
<UseDebugLibraries Condition="'$(Configuration)'=='Release'">false</UseDebugLibraries>
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<ItemGroup>
<ClInclude Include="src\metawear\**\cpp\*.h" />
<ClInclude Include="src\metawear\**\*.h" />
<ClCompile Include="src\metawear\core\**\*.cpp" />
<ClCompile Include="src\metawear\dfu\**\*.cpp" />
<ClCompile Include="src\metawear\impl\**\*.cpp" />
<ClCompile Include="src\metawear\peripheral\**\*.cpp" />
<ClCompile Include="src\metawear\platform\**\*.cpp" />
<ClCompile Include="src\metawear\processor\**\*.cpp" />
<ClCompile Include="src\metawear\sensor\**\*.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<IncludePath>$(MSBuildProjectDirectory)\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>METAWEAR_DLL_EXPORTS;_WINRT_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ dist/
└── lib
└── x64
├── libmetawear.so -> libmetawear.so.0
├── libmetawear.so.0 -> libmetawear.so.0.20.6
└── libmetawear.so.0.20.6
├── libmetawear.so.0 -> libmetawear.so.0.20.7
└── libmetawear.so.0.20.7

```

Expand Down
4 changes: 2 additions & 2 deletions project_version.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.20.6
VERSION=0.20.7
VERSION_MAJOR=0
VERSION_MINOR=20
VERSION_STEP=6
VERSION_STEP=7
3 changes: 2 additions & 1 deletion src/metawear/impl/cpp/metawearboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ int32_t response_handler_packed_data(MblMwMetaWearBoard *board, const uint8_t *r
MblMwDataSignal* signal;
auto it = board->module_events.find(header);

if (it == board->module_events.end() || (signal = dynamic_cast<MblMwDataSignal*>(it->second))->handler == nullptr) {
signal = dynamic_cast<MblMwDataSignal*>(it->second);
if (it == board->module_events.end() || signal->handler == nullptr) {
return MBL_MW_STATUS_WARNING_UNEXPECTED_SENSOR_DATA;
}

Expand Down

0 comments on commit b997e7b

Please sign in to comment.