Externals: add tinygltf, a library used to load or save GLTF mesh files

This commit is contained in:
iwubcode 2024-02-04 17:10:07 -06:00
parent 80d77ac0b4
commit ecfcae8718
8 changed files with 77 additions and 0 deletions

3
.gitmodules vendored
View File

@ -75,3 +75,6 @@
[submodule "hidapi-src"]
path = Externals/hidapi/hidapi-src
url = https://github.com/libusb/hidapi
[submodule "Externals/tinygltf/tinygltf"]
path = Externals/tinygltf/tinygltf
url = https://github.com/syoyo/tinygltf.git

View File

@ -638,6 +638,7 @@ add_subdirectory(Externals/glslang)
if(WIN32 OR APPLE)
add_subdirectory(Externals/spirv_cross)
endif()
add_subdirectory(Externals/tinygltf)
if(ENABLE_VULKAN)
add_definitions(-DHAS_VULKAN)

11
Externals/tinygltf/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,11 @@
add_library(tinygltf STATIC)
target_compile_definitions(tinygltf PUBLIC TINYGLTF_NOEXCEPTION)
target_compile_definitions(tinygltf PUBLIC TINYGLTF_NO_EXTERNAL_IMAGE)
target_compile_definitions(tinygltf PUBLIC TINYGLTF_USE_CPP14)
if (NOT MSVC)
target_compile_features(tinygltf PRIVATE cxx_std_20)
endif()
target_sources(tinygltf PRIVATE
tinygltf/tiny_gltf.cc)
target_include_directories(tinygltf INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
dolphin_disable_warnings_msvc(tinygltf)

14
Externals/tinygltf/exports.props vendored Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ExternalsDir)tinygltf;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TINYGLTF_NOEXCEPTION;TINYGLTF_NO_EXTERNAL_IMAGE;TINYGLTF_USE_CPP14;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="$(ExternalsDir)tinygltf\tinygltf.vcxproj">
<Project>{8bda3693-4999-4d11-9e52-8d08c30b643a}</Project>
</ProjectReference>
</ItemGroup>
</Project>

1
Externals/tinygltf/tinygltf vendored Submodule

@ -0,0 +1 @@
Subproject commit c5641f2c22d117da7971504591a8f6a41ece488b

35
Externals/tinygltf/tinygltf.vcxproj vendored Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="..\..\Source\VSProps\Base.Macros.props" />
<Import Project="$(VSPropsDir)Base.Targets.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{8bda3693-4999-4d11-9e52-8d08c30b643a}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VSPropsDir)Configuration.StaticLibrary.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VSPropsDir)Base.props" />
<Import Project="$(VSPropsDir)ClDisableAllWarnings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>tinygltf;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="tinygltf/tiny_gltf.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="tinygltf/json.hpp" />
<ClInclude Include="tinygltf/stb_image.h" />
<ClInclude Include="tinygltf/stb_image_write.h" />
<ClInclude Include="tinygltf/tiny_gltf.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -58,6 +58,7 @@
<Import Project="$(ExternalsDir)SFML\exports.props" />
<Import Project="$(ExternalsDir)soundtouch\exports.props" />
<Import Project="$(ExternalsDir)spirv_cross\exports.props" />
<Import Project="$(ExternalsDir)tinygltf\exports.props" />
<Import Project="$(ExternalsDir)xxhash\exports.props" />
<Import Project="$(ExternalsDir)zlib-ng\exports.props" />
<Import Project="$(ExternalsDir)zstd\exports.props" />

View File

@ -91,6 +91,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spng", "..\Externals\libspn
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rcheevos", "..\Externals\rcheevos\rcheevos.vcxproj", "{CC99A910-3752-4465-95AA-7DC240D92A99}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinygltf", "..\Externals\tinygltf\tinygltf.vcxproj", "{8BDA3693-4999-4D11-9E52-8D08C30B643A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@ -439,6 +441,14 @@ Global
{CC99A910-3752-4465-95AA-7DC240D92A99}.Release|ARM64.Build.0 = Release|ARM64
{CC99A910-3752-4465-95AA-7DC240D92A99}.Release|x64.ActiveCfg = Release|x64
{CC99A910-3752-4465-95AA-7DC240D92A99}.Release|x64.Build.0 = Release|x64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Debug|ARM64.Build.0 = Debug|ARM64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Debug|x64.ActiveCfg = Debug|x64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Debug|x64.Build.0 = Debug|x64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Release|ARM64.ActiveCfg = Release|ARM64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Release|ARM64.Build.0 = Release|ARM64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Release|x64.ActiveCfg = Release|x64
{8BDA3693-4999-4D11-9E52-8D08C30B643A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -477,6 +487,7 @@ Global
{3F17D282-A77D-4931-B844-903AD0809A5E} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
{447B7B1E-1D74-4AEF-B2B9-6EB41C5D5313} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
{CC99A910-3752-4465-95AA-7DC240D92A99} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
{8BDA3693-4999-4D11-9E52-8D08C30B643A} = {87ADDFF9-5768-4DA2-A33B-2477593D6677}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {64B0A343-3B94-4522-9C24-6937FE5EFB22}