Comments (9)
Yay, glad to hear that! π
Keeping this open until I add a better error message to the toolchain file as I mentioned above.
from corrade.
Yep, cross-building maybe not so friendly to a newcomer like me, but magnum is still a great project especially the architecture, i can hold on. Good job!
Fixed, thanks!
from corrade.
Since mosra/toolchains@c6eaa23 there's an explicit error message when Visual Studio generator is used with Emscripten, explaining what to do instead.
from corrade.
Hi!
This is a common issue on Windows -- CMake uses Visual Studio project files as a default generator on Windows, but Visual Studio projects insist on using MSVC as a compiler (so emcc
supplied by the Emscripten toolchain will get ignored). Solution is to specify a different generator (e.g. -G Ninja
, if you have Ninja installed). The troubleshooting docs contain more information, including how to use Ninja that's bundled in VS installations.
Since you're not the first person running into this, I'll look if this could be handled with a better error message in the toolchain file itself.
from corrade.
Yet, Get another error when generate Ninja project:
C:\workspace\corrade\build-emscripten>cmake .. -G Ninja -DCMAKE_MAKE_PROGRAM="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake" -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_PREFIX="C:/workspace/emsdk" -DCMAKE_INSTALL_PREFIX="C:/lib/emscripten/system"
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:50 (project):
The CMAKE_CXX_COMPILER:
C:/workspace/emsdk/em++.bat
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/workspace/corrade/build-emscripten/CMakeFiles/CMakeOutput.log".
See also "C:/workspace/corrade/build-emscripten/CMakeFiles/CMakeError.log".
from corrade.
Windows is not my primary system and I don't know much about emsdk, so I'm afraid I won't be able to help much... :/
Does C:/workspace/emsdk/em++.bat
exist at all? Alternatively, if you have em++.bat
in PATH, CMake should be able to pick that up correctly as well.
from corrade.
My fault, have assigned wrong value to EMSCRIPTEN_PREFIX
, em++.bat
is located in emsdk/emscripten/1.38.30
.
Ninja project has been generated! Thanks.
from corrade.
By the way, got another cmake error when building magnum target WASM,
there're UseCorrade.cmake
CorradeLibSuffix.cmake
files in my C:\lib\emscripten\system\share\cmake\Corrade
folder, how did cmake not find them with find_path
?
C:\workspace\magnum\build-emscripten>cmake .. -G Ninja -DCMAKE_MAKE_PROGRAM="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake" -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_PREFIX="C:/workspace/emsdk/emscripten/1.38.30" -DCMAKE_PREFIX_PATH="C:/lib/emscripten/system" -DCMAKE_INSTALL_PREFIX="C:/lib/emscripten/system" -DMAGNUM_DEPLOY_PREFIX="C:/http/magnum" -DWITH_SDL2APPLICATION=ON -DCORRADE_INCLUDE_DIR="C:/lib/emscripten/system/include"
CMake Error at modules/FindCorrade.cmake:291 (file):
file failed to open for reading (No such file or directory):
C:/workspace/magnum/_CORRADE_CONFIGURE_FILE-NOTFOUND
Call Stack (most recent call first):
CMakeLists.txt:52 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Corrade (missing: _CORRADE_MODULE_DIR
_CORRADE_CONFIGURE_FILE Containers Utility)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
modules/FindCorrade.cmake:552 (find_package_handle_standard_args)
CMakeLists.txt:52 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/workspace/magnum/build-emscripten/CMakeFiles/CMakeOutput.log".
See also "C:/workspace/magnum/build-emscripten/CMakeFiles/CMakeError.log".
from corrade.
Cross-compilation with CMake is painful, right? π
Have a look at this part of the troubleshooting guide -- in particular, adding -DCMAKE_FIND_ROOT_PATH=C:/lib/emscripten/system
could help. Hopefully (this is one featurebug of CMake I still don't understand, even after 10 years of using it). And then you shouldn't need to specify -DCORRADE_INCLUDE_DIR
.
The "nuclear" solution when everything goes wrong is opening CMake GUI in the directory and pointing all CORRADE_*
variables to the dirs/files manually. But that's really the most desperate solution when everything else fails.
from corrade.
Related Issues (20)
- Corrade's test suite fails under AddressSanitizer HOT 9
- Corrade with BUILD_TESTS=ON compilation error: call to non-βconstexprβ function HOT 5
- Error when installing via HunterGate HOT 7
- Prefix cmake options with CORRADE_ HOT 4
- Windows: inconsistent redefinition of _aligned_malloc HOT 3
- Corrade adds /wd*** warning disablements to "clang.exe" on windows. HOT 1
- Building Corrade with -std=c++20 causes errors inside MinGW <numbers> header HOT 3
- Corrade fails to compile with emscripten 3.1.22 HOT 4
- Opt-in to native UTF-8 support for OS interaction on Windows
- std::tuple_size / tuple_element specializations for Corrade containers HOT 1
- error: cannot initialize a variable of type 'const char *const' with an rvalue of type 'int' HOT 3
- Optimizing compilation time for the test suite -- an analysis HOT 3
- Interconnect - Slots are not called according to their record order HOT 1
- V8::Zone Allocator HOT 1
- NEON code does not build on armv7 HOT 2
- what to set CORRADE_INCLUDE_DIR to for in-source-builds HOT 2
- JsonToken::asObject() odd behavior with empty objects HOT 2
- New Release HOT 1
- Broken Interconnect on Clang-CL 16.0.5 HOT 9
- Packaging location of GDB script files HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corrade.