Changing the command ran by EMSDK when invoking CMake?

21 views
Skip to first unread message

Osman Zakir

unread,
May 10, 2019, 7:14:11 AM5/10/19
to emscripten-discuss
How do I change the command the EMSDK runs when invoking CMake to build a tool?  I want to have it use VS2017 or 2019 instead of VS2015.  

I tried this:
emsdk install emscripten-tag-1.38.31-64bit binaryen-tag-1.38.31-64bit vs-tool-0.9.4 -vs2017

But it still keeps doing this:
Running CMake: ['cmake', '-G', 'Visual Studio 14 Win64', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_EXECUTABLE=C:\\Python27\\python.exe', 'C:/emsdk/emscripten/tag-1.38.31\\tools\\optimizer']

(note the "Visual Studio 14 Win64" -- which isn't even correct since it has to be "Visual Studio 14 2015 Win64" to correctly invoke VS2015 for x64 platforms).  

Also note that CMake gives this warning when the flags 'PYTHON_EXECUTABLE" and "CMAKE_BUILD_TYPE are used when the EMSDK tries to build tools using CMake:
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE
    PYTHON_EXECUTABLE



Osman Zakir

unread,
May 10, 2019, 9:26:10 AM5/10/19
to emscripten-discuss
Just now, I tried doing it by adding "--vs2017" at the end, but it failed.  Here's the output:

emsdk install emscripten-tag-1.38.31-64bit binaryen-tag-1.38.31-64bit --vs2017
Installing tool 'emscripten-tag-1.38.31-64bit'..
The contents of file 'https://github.com/kripken/emscripten/archive/1.38.31.zip' already exist in destination 'C:/emsdk/emscripten/tag-1.38.31', skipping.
Running CMake: ['cmake', '-G', 'Visual Studio 15 Win64', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_EXECUTABLE=C:\\Python27\\python.exe', 'C:/emsdk/emscripten/tag-1.38.31\\tools\\optimizer']
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "C:/emsdk/emscripten/tag-1.38.31_vs2017_64bit_optimizer/CMakeFiles/CMakeOutput.log".
See also "C:/emsdk/emscripten/tag-1.38.31_vs2017_64bit_optimizer/CMakeFiles/CMakeError.log".
CMake invocation failed due to exception!
Working directory: C:/emsdk/emscripten/tag-1.38.31_vs2017_64bit_optimizer
Command '['cmake', '-G', 'Visual Studio 15 Win64', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_EXECUTABLE=C:\\Python27\\python.exe', 'C:/emsdk/emscripten/tag-1.38.31\\tools\\optimizer']' returned non-zero exit status 1
Installation failed!


When I run CMake on my own with VS2017 as the generator, it works correctly and generates the solution and project files.  So why isn't it working here?

Floh

unread,
May 10, 2019, 9:32:59 AM5/10/19
to emscripten-discuss
--vs2017 instead of -vs2017?

At least the double-dash is what the emsdk help says, I haven't actually tried using it yet (it may still use the wrong generator name as you noticed). May be worth it writing a ticket or provide a PR here: 

Osman Zakir

unread,
May 11, 2019, 7:50:57 AM5/11/19
to emscripten-discuss
Yeah, it's a double dash.  MDN's documentation has a single one, so that's the reason for the confusion.  

By the way, I have another question: is the upstream LLVM/Clang that the Wasm SDK that you can install through the EMSDK has the latest upstream version from the LLVM trunk (version 9), or is it still just Fastcomp?
Reply all
Reply to author
Forward
0 new messages