我目前正试图按照自述文件中的说明在Windows上构建Ammo.js。我有过
emcccmake (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe)显然,由于我在Windows上,cmake无法解析到CMakeLists.txt中的可执行文件的任何路径
set(EMSCRIPTEN_ROOT $ENV{EMSDK}/upstream/emscripten CACHE STRING "Emscripten path")因此,我不得不用我的二进制文件的全部路径来替换它们:
set(EMSCRIPTEN_ROOT "C:/Program Files/emsdk/upstream/emscripten" CACHE STRING "Emscripten path")
set(CMAKE_TOOLCHAIN_FILE "C:/Program Files/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake")
set(WEBIDL_BINDER_SCRIPT "C:/Program Files/emsdk/upstream/emscripten/tools/webidl_binder.py")现在,如果我运行cmake -B builds,那么cmake似乎没有错误地运行,但是它输出了以下文件:

cmake -B builds
-- Building for: Visual Studio 16 2019
-- Found Python3: C:/Python39/python.exe (found version "3.9.1") found components:
Interpreter CMake Deprecation Warning at bullet/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.
OPENGL FOUND
nul
-- WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY OPENGL_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: G:/dev/projects/ammo.js/builds 没有ammo.js,没有ammo.wasm.js,也没有ammo.wasm
当我尝试使用'MinGW Makefiles'标志进行编译时,它会出错:
cmake -B builds -G 'MinGW Makefiles'
-- Found Python3: C:/Python39/python.exe (found version "3.9.1") found components: Interpreter
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!我不能使用预构建文件作为对new Ammo.btBoxShape(new Ammo.btVector3())的调用抛出Uncaught (in promise) RuntimeError: memory access out of bounds,据我理解,在编译期间我需要分配一个更大的堆。
那么,如何在Windows上构建Ammo.js呢?
发布于 2021-05-06 09:17:32
这里有两个独立的问题
cmake --build builds,这是我在文档中忽略的。https://stackoverflow.com/questions/67402033
复制相似问题