在Windows上使用Emscripten和CMake编译GLFM的问题

时间:2018-04-27 21:37:53

标签: c++ cmake emscripten

我正在尝试使用emscripten和cmake编译GLFM。我按照GitHub页面上的说明进行操作,生成所有项目文件的cmake命令顺利运行(除了一些弃用警告),但当我输入行cmake --build .时,我收到错误。

以下是整个输出:

E:\emproj\glfm\build\emscripten>cmake --build .
Microsoft (R) Build Engine version 15.6.85.37198 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/27/2018 3:21:04 PM.
Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (1) is building "E:\emproj\glfm\build\emscripten\ZERO_CHECK
.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  All outputs are up-to-date.
FinalizeBuildStatus:
  Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "E:\emproj\glfm\build\emscripten\ZERO_CHECK.vcxproj" (default targets).

Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (1) is building "E:\emproj\glfm\build\emscripten\glfm.vcxpr
oj" (3) on node 1 (default targets).
InitializeBuildStatus:
  Touching "glfm.dir\Debug\glfm.tlog\unsuccessfulbuild".
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\CL.exe /c /IE
  :\emproj\glfm\include /IE:\emproj\glfm\src /nologo /W1 /WX- /diagnostics:classic /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\""
   /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"glfm.dir\Debug\\" /Fd"glfm.dir\Debug\glfm.
  pdb" /Gd /TC /analyze- /FC /errorReport:queue  -g -Weverything -Wwrite-strings -Wno-padded -Wno-covered-switch-defaul
  t E:\emproj\glfm\src\glfm_platform_emscripten.c
cl : Command line error D8021: invalid numeric argument '/Weverything' [E:\emproj\glfm\build\emscripten\glfm.vcxproj]
Done Building Project "E:\emproj\glfm\build\emscripten\glfm.vcxproj" (default targets) -- FAILED.

Done Building Project "E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (default targets) -- FAILED.


Build FAILED.

"E:\emproj\glfm\build\emscripten\ALL_BUILD.vcxproj" (default target) (1) ->
"E:\emproj\glfm\build\emscripten\glfm.vcxproj" (default target) (3) ->
(ClCompile target) ->
  cl : Command line error D8021: invalid numeric argument '/Weverything' [E:\emproj\glfm\build\emscripten\glfm.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.68

它的论点是/Weverything。我查看了项目的CMakeLists.txt文件,看起来这个命令只能在活动编译器被叮当时使用。这可能是问题吗?它是使用visual studio作为主机,它应该这样做吗?

它说emscripten 1.35.0是必需的,而且是我正在使用的确切版本。

我也按照说明在Android Studio中运行它并且它顺利运行。

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

此问题的解决方案如下:

不要使用Windows。

我使用的是Ubuntu,除了安装现代版本的cmake外,一切都很顺利。在搜索了一段时间之后,可以在此处找到适合我的方法:https://peshmerge.io/how-to-install-cmake-3-11-0-on-ubuntu-16-04/