build steps

This commit is contained in:
2026-06-07 22:55:56 +08:00
parent dff504ef67
commit 7b42a6be63
14 changed files with 467 additions and 18 deletions
+14 -1
View File
@@ -9,7 +9,14 @@ option(LEANCLR_GODOT_FETCH_GODOT_CPP "Fetch godot-cpp when GODOT_CPP_ROOT is not
set(GODOT_CPP_ROOT "" CACHE PATH "Path to a checked-out godot-cpp tree")
set(GODOT_CPP_LIBRARY "" CACHE FILEPATH "Path to a prebuilt godot-cpp static library. When set, godot-cpp is imported instead of built.")
set(GODOT_CPP_GEN_INCLUDE_DIR "" CACHE PATH "Path to godot-cpp generated headers, for example <godot-cpp-build>/gen/include")
set(GODOT_CPP_BRANCH "4.4" CACHE STRING "godot-cpp branch or tag to use when fetching")
set(GODOT_CPP_BRANCH "4.5" CACHE STRING "godot-cpp branch or tag to use when fetching")
# Only the Web build is single-threaded today — pthreads in a wasm side
# module is experimental and the demo does not need it. Forward to godot-cpp
# so its own -sUSE_PTHREADS=1 (see godot-cpp/cmake/web.cmake) is not emitted.
if(EMSCRIPTEN)
set(GODOTCPP_THREADS OFF CACHE BOOL "godot-cpp threading support" FORCE)
endif()
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "Select the MSVC runtime library for GDExtension binaries." FORCE)
@@ -119,6 +126,12 @@ endif()
if(EMSCRIPTEN)
target_link_options(leanclr_godot PRIVATE -sSIDE_MODULE=1)
set_target_properties(leanclr_godot PROPERTIES SUFFIX ".wasm")
# The auto-generated godot_api.generated.cpp has thousands of invoker
# functions; at -O3 the compiler inlines argument unpacking and blows
# past V8's 50,000-locals-per-function limit ("local count too large" at
# runtime). Cap the web build at -O1 to keep each function's locals
# manageable.
target_compile_options(leanclr_godot PRIVATE -O1)
endif()
set_target_properties(leanclr_godot PROPERTIES