emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Check if cmake is on the PATH in emcmake.py

Open Peter0x44 opened this issue 1 year ago • 1 comments

Currently, users who run emcmake without cmake on the PATH are greeted with confusing errors like:

emcmake cmake ..
configure: cmake .. -DCMAKE_TOOLCHAIN_FILE=D:\src\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=D:/src/emsdk/node/18.20.3_64bit/bin/node.exe -G Ninja emcmake: error: 'cmake .. -DCMAKE_TOOLCHAIN_FILE=D:\src\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=D:/src/emsdk/node/18.20.3_64bit/bin/node.exe -G Ninja' failed: [WinError 2] The system cannot find the file specified

Peter0x44 avatar Sep 03 '24 15:09 Peter0x44

I'm not sure if users have any reason not to have CMake on their PATH, maybe the error could be adjusted to only happen if argv[0] == "cmake" or so.

Also, open to suggestions to change the wording.

Peter0x44 avatar Sep 03 '24 15:09 Peter0x44

I think some flaky install for a test failed and stopped this from getting merged.

Failures
 - ninja (exited 1) - ninja not installed. An error occurred during installation:
 Error downloading 'ninja.1.13.1' from 'https://community.chocolatey.org/api/v2/package/ninja/1.13.1'.
 - pkgconfiglite (exited 1) - pkgconfiglite not installed. An error occurred during installation:
 Error downloading 'pkgconfiglite.0.28.0' from 'https://community.chocolatey.org/api/v2/package/pkgconfiglite/0.28'.

Peter0x44 avatar Jul 18 '25 13:07 Peter0x44