Skip to content

Commit 68db615

Browse files
Fixed Android build issues
1 parent a2da93a commit 68db615

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6819
-19
lines changed

Common/include/DebugUtilities.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#ifdef _DEBUG
3030

31+
#include <typeinfo>
32+
3133
// This function is only requried to ensure that Message argument passed to the macro
3234
// is actually string and not something else
3335
inline void EnsureStr( const char* ){}
@@ -58,7 +60,7 @@ inline void EnsureStr( const char* ){}
5860
template<typename DstType, typename SrcType>
5961
void CheckDynamicType( SrcType *pSrcPtr )
6062
{
61-
VERIFY( pSrcPtr == nullptr || dynamic_cast<DstType*> (pSrcPtr) != nullptr, "Dynamic type cast failed!" );
63+
VERIFY(pSrcPtr == nullptr || dynamic_cast<DstType*> (pSrcPtr) != nullptr, "Dynamic type cast failed. Src typeid: \'", typeid(*pSrcPtr).name(), "\' Dst typeid: \'", typeid(DstType).name(), '\'');
6264
}
6365
# define CHECK_DYNAMIC_TYPE(DstType, pSrcPtr) CheckDynamicType<DstType>(pSrcPtr)
6466

Common/include/FixedBlockMemoryAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class FixedBlockMemoryAllocator : public IMemoryAllocator
211211

212212
std::vector<MemoryPage, STDAllocatorRawMem<MemoryPage> > m_PagePool;
213213
std::unordered_set<size_t, std::hash<size_t>, std::equal_to<size_t>, STDAllocatorRawMem<size_t> > m_AvailablePages;
214-
typedef std::pair<void*, size_t> AddrToPageIdMapElem;
214+
typedef std::pair<void* const, size_t> AddrToPageIdMapElem;
215215
std::unordered_map<void*, size_t, std::hash<void*>, std::equal_to<void*>, STDAllocatorRawMem<AddrToPageIdMapElem> > m_AddrToPageId;
216216

217217
std::mutex m_Mutex;

Common/include/ValidatedCast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ DstType* ValidatedCast( SrcType *Ptr )
3434
CHECK_DYNAMIC_TYPE( DstType, Ptr );
3535
}
3636
#endif
37-
return static_cast<DstType*>( Ptr );
37+
return Ptr != nullptr ? static_cast<DstType*>( Ptr ) : nullptr;
3838
}

Common/make/AppCommon.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
APP_PLATFORM := android-19
33
APP_ABI := armeabi-v7a
4-
# NDK_TOOLCHAIN_VERSION := clang
54
NDK_TOOLCHAIN_VERSION := 4.9
65
APP_STL := gnustl_static
6+
# NDK_TOOLCHAIN_VERSION := clang
7+
# APP_STL := c++_static
78

89
ifeq ($(APP_OPTIM),release)
910
APP_CFLAGS := -O2 -DNDEBUG -g $(APP_CFLAGS)
1011
else
1112
APP_CFLAGS := -O0 -g -D_DEBUG $(APP_CFLAGS)
12-
# APP_CPPFLAGS := -frtti $(APP_CPPFLAGS)
13-
APP_CPPFLAGS := --rtti $(APP_CPPFLAGS)
13+
APP_CPPFLAGS := -frtti $(APP_CPPFLAGS)
1414
endif

Common/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Initial release
2121

2222
**Copyright 2015-2017 Egor Yusov**
2323

24-
[Diligent Graphics](http://diligentgraphics.com)
24+
[Diligent Graphics](http://diligentgraphics.com)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0"?>
2+
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ConfigurationName>Debug</ConfigurationName>
4+
<Project xsi:type="com.visualgdb.project.android">
5+
<CustomSourceDirectories>
6+
<Directories />
7+
<PathStyle>MinGWWindowsSlash</PathStyle>
8+
</CustomSourceDirectories>
9+
<AndroidProjectPath>$(ProjectDir)</AndroidProjectPath>
10+
</Project>
11+
<Build xsi:type="com.visualgdb.build.android">
12+
<AndroidPlatform>android-19</AndroidPlatform>
13+
<IsDebugConfiguration>true</IsDebugConfiguration>
14+
<JNIOnlyBuild>true</JNIOnlyBuild>
15+
<AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean>
16+
<DeleteANTFilesOnClean>false</DeleteANTFilesOnClean>
17+
<DoNotEditAndroidManifest>false</DoNotEditAndroidManifest>
18+
<CustomActions />
19+
</Build>
20+
<Debug xsi:type="com.visualgdb.debug.android">
21+
<AdditionalStartupCommands />
22+
<AdditionalGDBSettings>
23+
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
24+
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
25+
<PendingBreakpointsSupported>true</PendingBreakpointsSupported>
26+
<DisableChildRanges>false</DisableChildRanges>
27+
<UseAppleExtensions>false</UseAppleExtensions>
28+
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
29+
<MakeLogFile>false</MakeLogFile>
30+
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
31+
<UseRelativePathsOnly>false</UseRelativePathsOnly>
32+
<ExitAction>KillApp</ExitAction>
33+
<Features>
34+
<DisableAutoDetection>false</DisableAutoDetection>
35+
<UseFrameParameter>false</UseFrameParameter>
36+
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
37+
<ListLocalsSupported>false</ListLocalsSupported>
38+
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
39+
<ThreadInfoSupported>false</ThreadInfoSupported>
40+
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
41+
<SupportTargetCommand>false</SupportTargetCommand>
42+
</Features>
43+
<DisableDisassembly>false</DisableDisassembly>
44+
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
45+
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
46+
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
47+
</AdditionalGDBSettings>
48+
<LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" />
49+
<GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC>
50+
<UseDefaultInstallDir>false</UseDefaultInstallDir>
51+
<RemotePort>5039</RemotePort>
52+
<LocalPort>5039</LocalPort>
53+
<GDBServerStartupTimeout>10000</GDBServerStartupTimeout>
54+
<AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay>
55+
<DoubleSlashWorkaround>false</DoubleSlashWorkaround>
56+
<AlreadyRunningDecision>Ask</AlreadyRunningDecision>
57+
<ShowLogCat>true</ShowLogCat>
58+
<EnableThreadNameWatcher>true</EnableThreadNameWatcher>
59+
</Debug>
60+
<CustomBuild>
61+
<PreBuildActions />
62+
<PostBuildActions />
63+
<PreCleanActions />
64+
<PostCleanActions />
65+
</CustomBuild>
66+
<CustomDebug>
67+
<PreDebugActions />
68+
<PostDebugActions />
69+
<BreakMode>Default</BreakMode>
70+
</CustomDebug>
71+
<CustomShortcuts>
72+
<Shortcuts />
73+
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
74+
</CustomShortcuts>
75+
<UserDefinedVariables />
76+
</VisualGDBProjectSettings2>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0"?>
2+
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<ConfigurationName>Release</ConfigurationName>
4+
<Project xsi:type="com.visualgdb.project.android">
5+
<CustomSourceDirectories>
6+
<Directories />
7+
<PathStyle>MinGWWindowsSlash</PathStyle>
8+
</CustomSourceDirectories>
9+
<AndroidProjectPath>$(ProjectDir)</AndroidProjectPath>
10+
</Project>
11+
<Build xsi:type="com.visualgdb.build.android">
12+
<AndroidPlatform>android-19</AndroidPlatform>
13+
<IsDebugConfiguration>false</IsDebugConfiguration>
14+
<JNIOnlyBuild>true</JNIOnlyBuild>
15+
<AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean>
16+
<DeleteANTFilesOnClean>false</DeleteANTFilesOnClean>
17+
<DoNotEditAndroidManifest>false</DoNotEditAndroidManifest>
18+
<CustomActions />
19+
</Build>
20+
<Debug xsi:type="com.visualgdb.debug.android">
21+
<AdditionalStartupCommands />
22+
<AdditionalGDBSettings>
23+
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
24+
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
25+
<PendingBreakpointsSupported>true</PendingBreakpointsSupported>
26+
<DisableChildRanges>false</DisableChildRanges>
27+
<UseAppleExtensions>false</UseAppleExtensions>
28+
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
29+
<MakeLogFile>false</MakeLogFile>
30+
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
31+
<UseRelativePathsOnly>false</UseRelativePathsOnly>
32+
<ExitAction>KillApp</ExitAction>
33+
<Features>
34+
<DisableAutoDetection>false</DisableAutoDetection>
35+
<UseFrameParameter>false</UseFrameParameter>
36+
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
37+
<ListLocalsSupported>false</ListLocalsSupported>
38+
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
39+
<ThreadInfoSupported>false</ThreadInfoSupported>
40+
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
41+
<SupportTargetCommand>false</SupportTargetCommand>
42+
</Features>
43+
<DisableDisassembly>false</DisableDisassembly>
44+
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
45+
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
46+
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
47+
</AdditionalGDBSettings>
48+
<LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" />
49+
<GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC>
50+
<UseDefaultInstallDir>false</UseDefaultInstallDir>
51+
<RemotePort>5039</RemotePort>
52+
<LocalPort>5039</LocalPort>
53+
<GDBServerStartupTimeout>10000</GDBServerStartupTimeout>
54+
<AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay>
55+
<DoubleSlashWorkaround>false</DoubleSlashWorkaround>
56+
<AlreadyRunningDecision>Ask</AlreadyRunningDecision>
57+
<ShowLogCat>true</ShowLogCat>
58+
<EnableThreadNameWatcher>true</EnableThreadNameWatcher>
59+
</Debug>
60+
<CustomBuild>
61+
<PreBuildActions />
62+
<PostBuildActions />
63+
<PreCleanActions />
64+
<PostCleanActions />
65+
</CustomBuild>
66+
<CustomDebug>
67+
<PreDebugActions />
68+
<PostDebugActions />
69+
<BreakMode>Default</BreakMode>
70+
</CustomDebug>
71+
<CustomShortcuts>
72+
<Shortcuts />
73+
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
74+
</CustomShortcuts>
75+
<UserDefinedVariables />
76+
</VisualGDBProjectSettings2>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|ARM">
9+
<Configuration>Release</Configuration>
10+
<Platform>ARM</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{22BA09AE-E0B5-49F1-8403-2A824762376E}</ProjectGuid>
15+
<RootNamespace>AndroidPlatform</RootNamespace>
16+
</PropertyGroup>
17+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
18+
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
19+
<PlatformToolset>v120</PlatformToolset>
20+
<ConfigurationType>Makefile</ConfigurationType>
21+
</PropertyGroup>
22+
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
23+
<PlatformToolset>v120</PlatformToolset>
24+
<ConfigurationType>Makefile</ConfigurationType>
25+
</PropertyGroup>
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
27+
<ImportGroup Label="ExtensionSettings">
28+
</ImportGroup>
29+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
30+
<Import Project="..\..\..\..\Shared\build\Windows\Android32d.props" />
31+
</ImportGroup>
32+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
33+
<Import Project="..\..\..\..\Shared\build\Windows\Android32r.props" />
34+
</ImportGroup>
35+
<PropertyGroup Label="UserMacros" />
36+
<PropertyGroup />
37+
<ItemGroup>
38+
<None Include="jni\Android.mk" />
39+
<None Include="jni\Application.mk" />
40+
</ItemGroup>
41+
<ItemGroup>
42+
<ClCompile Include="..\src\gestureDetector.cpp" />
43+
<ClCompile Include="..\src\JNIHelper.cpp" />
44+
<ClCompile Include="..\src\perfMonitor.cpp" />
45+
<ClCompile Include="..\src\sensorManager.cpp" />
46+
<ClCompile Include="..\src\tapCamera.cpp" />
47+
<ClCompile Include="..\src\vecmath.cpp" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<ClInclude Include="..\include\gestureDetector.h" />
51+
<ClInclude Include="..\include\JNIHelper.h" />
52+
<ClInclude Include="..\include\perfMonitor.h" />
53+
<ClInclude Include="..\include\sensorManager.h" />
54+
<ClInclude Include="..\include\tapCamera.h" />
55+
<ClInclude Include="..\include\vecmath.h" />
56+
</ItemGroup>
57+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
58+
<ImportGroup Label="ExtensionTargets">
59+
</ImportGroup>
60+
</Project>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="jni">
9+
<UniqueIdentifier>{5af229be-bfa0-48dc-9c77-f42bceac4839}</UniqueIdentifier>
10+
</Filter>
11+
<Filter Include="Header Files">
12+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
13+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
14+
</Filter>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<None Include="jni\Android.mk">
18+
<Filter>jni</Filter>
19+
</None>
20+
<None Include="jni\Application.mk">
21+
<Filter>jni</Filter>
22+
</None>
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ClCompile Include="..\src\gestureDetector.cpp">
26+
<Filter>Source Files</Filter>
27+
</ClCompile>
28+
<ClCompile Include="..\src\JNIHelper.cpp">
29+
<Filter>Source Files</Filter>
30+
</ClCompile>
31+
<ClCompile Include="..\src\sensorManager.cpp">
32+
<Filter>Source Files</Filter>
33+
</ClCompile>
34+
<ClCompile Include="..\src\tapCamera.cpp">
35+
<Filter>Source Files</Filter>
36+
</ClCompile>
37+
<ClCompile Include="..\src\perfMonitor.cpp">
38+
<Filter>Source Files</Filter>
39+
</ClCompile>
40+
<ClCompile Include="..\src\vecmath.cpp">
41+
<Filter>Source Files</Filter>
42+
</ClCompile>
43+
</ItemGroup>
44+
<ItemGroup>
45+
<ClInclude Include="..\include\gestureDetector.h">
46+
<Filter>Header Files</Filter>
47+
</ClInclude>
48+
<ClInclude Include="..\include\JNIHelper.h">
49+
<Filter>Header Files</Filter>
50+
</ClInclude>
51+
<ClInclude Include="..\include\tapCamera.h">
52+
<Filter>Header Files</Filter>
53+
</ClInclude>
54+
<ClInclude Include="..\include\perfMonitor.h">
55+
<Filter>Header Files</Filter>
56+
</ClInclude>
57+
<ClInclude Include="..\include\sensorManager.h">
58+
<Filter>Header Files</Filter>
59+
</ClInclude>
60+
<ClInclude Include="..\include\vecmath.h">
61+
<Filter>Header Files</Filter>
62+
</ClInclude>
63+
</ItemGroup>
64+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Android NDK project makefile autogenerated by Premake
2+
3+
# Preamble
4+
DEPENDENCY_PATH := $(call my-dir)
5+
LOCAL_PATH := $(abspath $(DEPENDENCY_PATH))
6+
include $(CLEAR_VARS)
7+
8+
9+
# Project configuration
10+
LOCAL_MODULE := NdkHelper
11+
LOCAL_CFLAGS := -std=c++11
12+
LOCAL_CPP_FEATURES := exceptions
13+
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue
14+
LOCAL_EXPORT_LDLIBS := -llog -landroid
15+
16+
# Include paths
17+
PROJECT_ROOT := $(LOCAL_PATH)/../..
18+
LOCAL_C_INCLUDES := $(PROJECT_ROOT)/include
19+
20+
# Source files
21+
#VisualGDBAndroid: AutoUpdateSourcesInNextLine
22+
LOCAL_SRC_FILES := ../../src/gestureDetector.cpp ../../src/JNIHelper.cpp ../../src/perfMonitor.cpp ../../src/sensorManager.cpp ../../src/tapCamera.cpp ../../src/vecmath.cpp
23+
24+
include $(BUILD_STATIC_LIBRARY)
25+
26+
$(call import-module,android/native_app_glue)

0 commit comments

Comments
 (0)