Files
mtgodot-poc/tools/granny-oracle/CMakeLists.txt
T
shenleiandClaude Opus 5.5 a46093104c layout: restructure into src/ tests/ android/ scripts/ tools/
- extension/src/{port,platform,codepage} -> src/; native_render -> src/host
  (+ dxt, shaders/); libgr2 -> src/gr2; extension/third_party -> third_party
- extension/tests -> tests/port, libgr2/tests -> tests/gr2
- android-native -> android (build.sh, push-client.sh moved in)
- script -> scripts; tools/40250 -> tools/server; oracle -> tools/granny-oracle;
  perf tools -> tools/perf
- all build trees under build/ (native, release, android, port-gate)
- xrender:: CMake aliases -> mt::; port-map ledger impl paths rewritten

No code changes. ctest 15/15, port_gate macos+android PASS, port_map check 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:08:19 +09:00

47 lines
2.3 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# oracle —— 独立 Windows 工程(不在主 CMake 树内)。见 ../docs/steps/00-oracle.md、RUNBOOK.md
#
# cmake -S oracle -B tools/granny-oracle/build -DGRANNY_SDK=<泄露 SDK 根>
# cmake --build tools/granny-oracle/build --config Release
#
# GRANNY_SDK 默认指向本仓库同级的 MobileSource 里的 Granny-3D-SDK-main。
# 链 granny2_x64.lib(import lib);运行时需要对应的 granny2_x64.dll 在 PATH / exe 目录。
# ⚠ 这个 DLL 是 SDK 2.9.12。资产由 2.4.0.7 导出(M0 T2 实测)。容器 + 组合公式在 2.4–2.11
# 稳定,但 B 样条边界 / 少数曲线细节可能有差异 —— 先跑 selfcheck(T7)确认坐标约定,
# 再决定是否要换成 2.4.x 的 runtime DLL(见 GRANNY-VERSION.md)。
cmake_minimum_required(VERSION 3.20)
project(xrender_oracle C)
set(CMAKE_C_STANDARD 11)
set(GRANNY_SDK "${CMAKE_SOURCE_DIR}/../../../MobileSource/Cross Platform/Granny-3D-SDK-main"
CACHE PATH "泄露 Granny SDK 根(含 include/ 和 lib/win64/)")
if(NOT EXISTS "${GRANNY_SDK}/include/granny.h")
message(FATAL_ERROR "找不到 ${GRANNY_SDK}/include/granny.h —— 传 -DGRANNY_SDK=<SDK 根>")
endif()
add_executable(oracle oracle.c)
target_include_directories(oracle PRIVATE "${GRANNY_SDK}/include")
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
target_link_libraries(oracle PRIVATE "${GRANNY_SDK}/lib/win64/granny2_x64.lib")
set(_dll "${GRANNY_SDK}/lib/win64/granny2_x64.dll")
else()
target_link_libraries(oracle PRIVATE "${GRANNY_SDK}/lib/win32/granny2.lib")
set(_dll "${GRANNY_SDK}/lib/win32/granny2.dll")
endif()
# 把 DLL 拷到 exe 旁边,方便直接跑 / Wine
add_custom_command(TARGET oracle POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_dll}" "$<TARGET_FILE_DIR:oracle>")
else()
message(WARNING
"非 Windows:SDK 只提供 win32/win64/wii/ps3/xenon 的 granny2 预编译库。\n"
" 选项 A:在 Windows 机器 / VM 上 build+run。\n"
" 选项 B:Wine(oracle 只做文件 IO + 数学 + 写二进制,不碰 GPU,Wine 够用)——\n"
" 用 MinGW 交叉编译或直接在 Wine 里跑 MSVC,链 granny2_x64.lib。\n"
" 选项 C(stretch):从 SDK source/ 移植 winxx/ 平台层出一个 POSIX libgranny。\n"
" 见 RUNBOOK.md。")
endif()