chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
27
tools/web/openusd-static-python.cmake
Normal file
27
tools/web/openusd-static-python.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
# Included after the original OpenUSD module declarations. Derive both the
|
||||
# linker inputs and CPython registrations from exactly the wrappers built.
|
||||
if(NOT PXR_WEB_STATIC_PYTHON)
|
||||
return()
|
||||
endif()
|
||||
if(NOT EMSCRIPTEN OR BUILD_SHARED_LIBS)
|
||||
message(FATAL_ERROR "PXR_WEB_STATIC_PYTHON requires the static Emscripten build")
|
||||
endif()
|
||||
get_property(modules GLOBAL PROPERTY PXR_WEB_PYTHON_MODULES)
|
||||
set(header "#pragma once\n#include <Python.h>\n")
|
||||
set(registrations "")
|
||||
set(libraries "get_filename_component(_pxr_web_root \"\${CMAKE_CURRENT_LIST_DIR}/..\" ABSOLUTE)\nset(WEB_USD_PYTHON_LIBRARIES)\n")
|
||||
foreach(module IN LISTS modules)
|
||||
string(REPLACE "|" ";" fields "${module}")
|
||||
list(GET fields 0 package)
|
||||
list(GET fields 1 wrapper)
|
||||
string(APPEND header "extern \"C\" PyObject *PyInit_${wrapper}();\n")
|
||||
string(APPEND registrations
|
||||
" if (PyImport_AppendInittab(\"pxr.${package}.${wrapper}\", PyInit_${wrapper}) < 0) return -1;\n")
|
||||
string(APPEND libraries
|
||||
"list(APPEND WEB_USD_PYTHON_LIBRARIES \"\${_pxr_web_root}/lib/python/pxr/${package}/${wrapper}${CMAKE_STATIC_LIBRARY_SUFFIX}\")\n")
|
||||
endforeach()
|
||||
string(APPEND header "inline int web_engine_register_usd_python()\n{\n${registrations} return 0;\n}\n")
|
||||
file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/web_engine_usd_python.hh" CONTENT "${header}")
|
||||
file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/webengine-pxr.cmake" CONTENT "${libraries}")
|
||||
install(FILES "${PROJECT_BINARY_DIR}/web_engine_usd_python.hh" DESTINATION include)
|
||||
install(FILES "${PROJECT_BINARY_DIR}/webengine-pxr.cmake" DESTINATION cmake)
|
||||
Reference in New Issue
Block a user