Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add microsoft gltf-sdk #6159

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

Conversation

jsjtxietian
Copy link
Contributor

Add https://github.com/microsoft/glTF-SDK , could be useful to game developers.

However I need some help as I don't know why the test fails, cc @star-hengxing

@star-hengxing
Copy link
Contributor

  • Fix compilation error.
  • Unbundle deps and remove gtest find_package.
  • Remove pdb installation for windows plat, xmake will automatically copy.

Comment on lines +19 to +25
local configs = {
"-DENABLE_UNIT_TESTS=OFF",
"-DENABLE_SAMPLES=OFF",
"-DRAPIDJSON_BUILD_DOC=OFF",
"-DRAPIDJSON_BUILD_EXAMPLES=OFF",
"-DRAPIDJSON_BUILD_TESTS=OFF",
}
Copy link
Contributor

@luadebug luadebug Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local configs = {
"-DENABLE_UNIT_TESTS=OFF",
"-DENABLE_SAMPLES=OFF",
"-DRAPIDJSON_BUILD_DOC=OFF",
"-DRAPIDJSON_BUILD_EXAMPLES=OFF",
"-DRAPIDJSON_BUILD_TESTS=OFF",
}
os.rm("External")
io.replace("Build/CMake/Modules/GLTFPlatform.cmake", "elseif (MSVC)", "elseif (MSVC OR MINGW)", {plain = true})
io.replace("Build/CMake/Modules/GLTFPlatform.cmake", "install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${PROJECT_NAME}.pdb DESTINATION ${CMAKE_SOURCE_DIR}/Built/Out/${platform}/$<CONFIG>/${PROJECT_NAME})", "", {plain = true})
io.replace("Build/CMake/Modules/GLTFPlatform.cmake", "${CMAKE_SOURCE_DIR}/Built/Out/${platform}/$<CONFIG>/${PROJECT_NAME}", "lib", {plain = true})
io.replace("GLTFSDK/CMakeLists.txt",
"CreateGLTFInstallTargets(GLTFSDK ${Platform})",
"CreateGLTFInstallTargets(GLTFSDK ${Platform})\ninstall(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/Inc/GLTFSDK DESTINATION ${CMAKE_INSTALL_PREFIX}/include)", {plain = true})
io.replace("CMakeLists.txt", "/MP", "", {plain = true})
io.replace("CMakeLists.txt", "if(NOT IOS)", "if(1)", {plain = true})
io.replace("CMakeLists.txt", "if(NOT RapidJSON_FOUND)", "if(0)", {plain = true})
io.replace("CMakeLists.txt", "find_package(GTest CONFIG)", "", {plain = true})
io.replace("CMakeLists.txt", "if(NOT GTest_FOUND)", "if(0)", {plain = true})
local configs = {
"-DENABLE_UNIT_TESTS=OFF",
"-DENABLE_SAMPLES=OFF",
}

Dunno seems its good to limit linux because it uses powershell OR MAYBE EVEN MORE IDK.

find_program(POWERSHELL_PATH NAMES pwsh powershell NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)

add_custom_command(
    OUTPUT ${CMAKE_BINARY_DIR}/GeneratedFiles/SchemaJson.h
    COMMAND ${POWERSHELL_PATH}

But we can make binary package of this maybe? https://github.com/PowerShell/PowerShell/releases/tag/v7.4.6
Or using existing grabbing mechanism from nuget, but im not sure it will be fine for linux and others %_%
https://www.nuget.org/packages/PowerShell/#supportedframeworks-body-tab
Yet without pwsh/powershell packaged its

on_install("windows", "mingw@windows,msys", function (package)

I believe...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use binary package for windows. but only for windows. There will be compatibility issues on Linux

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants