首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Windows上构建Ammo.js?

如何在Windows上构建Ammo.js?
EN

Stack Overflow用户
提问于 2021-05-05 13:12:20
回答 1查看 133关注 0票数 0

我目前正试图按照自述文件中的说明在Windows上构建Ammo.js。我有过

  • 路径中的emcc
  • 通过Visual安装cmake (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe)
  • 通过巧克力安装MinGW

显然,由于我在Windows上,cmake无法解析到CMakeLists.txt中的可执行文件的任何路径

代码语言:javascript
复制
set(EMSCRIPTEN_ROOT $ENV{EMSDK}/upstream/emscripten CACHE STRING "Emscripten path")

因此,我不得不用我的二进制文件的全部路径来替换它们:

代码语言:javascript
复制
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似乎没有错误地运行,但是它输出了以下文件:

代码语言:javascript
复制
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'标志进行编译时,它会出错:

代码语言:javascript
复制
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呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-06 09:17:32

这里有两个独立的问题

  1. 从巧克力中安装的MinGw不包括mingw32-make.exe。我卸载了它,得到了MinGW-安装程序,并按照下面的回答:CMake错误: CMake无法找到与"MinGW Makefiles“相对应的构建程序
  2. 我必须在第一个命令之后实际运行cmake --build builds,这是我在文档中忽略的。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67402033

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档