-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues building for Emscripten #106
Comments
Hi, no, it's not an error on your side. It took me a while to realize what's wrong, but then I discovered that I updated only the magnum-examples repo after Emscripten introduced Adding the following line here should install also the memory file: install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MyApplication.js.mem DESTINATION ${CMAKE_INSTALL_PREFIX} OPTIONAL) Please confirm that this works for you, I'll commit the change to the bootstrap project after that. Just some notes, regarding the script:
cd ~/projhome/magnum-bootstrap
rm -rf .git
git init .
git submodule add git://github.com/mosra/toolchains.git toolchains |
Thanks for the quick reply. Yes, adding that line fixed the problem with .mem not being copied over. Suggestion: have you thought of making a simple project generator (where you could select which targets you wanted to generate for, etc)? That would make this much more frictionless. Question #1: Is there a way to generate an XCode project from the command line? # Prerequisites:
# - CMake installed (3.3.1)
# - Directory ~/projhome created
# - Emscripten installed to ~/projhome/emsdk_portable
# - Symlink from /usr/lib/emscripten created to ~/projhome/emsdk_portable/emscripten/tag-1.34.6/
# sudo ln -s ~/projhome/emsdk_portable/emscripten/tag-1.34.6/ /usr/lib/emscripten
# Step 1 - Install Corrade
cd ~/projhome
git clone git://github.com/mosra/corrade.git
# Step 2 - Compile and install Corrade for emscripten
cd ~/projhome/corrade
git submodule init
git submodule update
mkdir -p build-emscripten && cd build-emscripten
cmake .. \
-DCMAKE_MODULE_PATH="~/projhome/corrade/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr/lib/emscripten/system"
make install
# Step 3 - Compile and install Corrade for desktop
cd ~/projhome/corrade
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
make install
# Step 4 - Install magnum
cd ~/projhome
git clone git://github.com/mosra/magnum.git
# Step 5 - Compile magnum
cd ~/projhome/magnum
mkdir -p build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_SDL2APPLICATION=ON
make
make install
# Step 6 - Compile magnum for emscripten
cd ~/projhome/magnum
git submodule init
git submodule update
mkdir -p build-emscripten && cd build-emscripten
cmake .. \
-DCMAKE_MODULE_PATH="~/projhome/magnum/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="/usr/lib/emscripten/system" \
-DCMAKE_INSTALL_PREFIX="/usr/lib/emscripten/system"
make
make install
# Step 7 - Compile and install Magnum for desktop
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=./ ..
make
make install
#Step 8 - Checkout and compile bootstrap project
cd ~/projhome
git clone https://github.com/mosra/magnum-bootstrap.git
cd ~/projhome/magnum-bootstrap/
git checkout base-emscripten
git submodule init
git submodule update
rm -rf .git
cd ~/projhome/magnum-bootstrap/
mkdir -p build-emscripten && cd build-emscripten
cmake .. \
-DCMAKE_MODULE_PATH="~/projhome/magnum/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="/usr/lib/emscripten/system" \
-DCMAKE_INSTALL_PREFIX="./bin" \
-DWITH_SDL2APPLICATION=ON
make
make install
# Step 9 - Checkout and compile samples
cd ~/projhome
git clone https://github.com/mosra/magnum-examples.git
cd magnum-examples
git submodule init
git submodule update
cd ~/projhome/magnum-examples
mkdir -p build && cd build
cmake .. \
-DCMAKE_MODULE_PATH="~/projhome/magnum/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="/usr/lib/emscripten/system" \
-DCMAKE_INSTALL_PREFIX="./bin" \
-DWITH_SDL2APPLICATION=ON
make
make install |
Can you be more specific? Do you mean some sort of wizard? There's CMake GUI which you can use instead of the command line, some IDEs also have some sort of CMake wizard integrated. I have some kind of Git "superproject" planned, which would allow you to clone and build everything in single place, but there are tasks that have more priority now.
Yes, passing
Yeah, sorry, this is rather undocumented -- samples for Emscripten are in the Currently only the |
The installation was fixed some time ago in mosra/magnum-bootstrap@18ef849, closing as solved. |
I think I'm close here, but there's something not quite right with my build procedure.
I'm on Mac OS X. I have the 'emsdk_portable' directory installed to '
/projhome' and I've made a '/usr/lib/emscripten' symlink linking to the latest emscripten sdk (/projhome/emsdk_portable/emscripten/tag-1.34.6/).The following is the script I've devised to automate getting, configuring and building. I think some of my parameters may be off, but it is mostly working. One issue that I am hacking around (but which may be a sign of something more broken) is that after the bootstrap project builds, the file "MyApplication.js.mem" is not in the right location.
I can make it run if I execute "cp src/CMakeFiles/CMakeRelink.dir/* bin/" to manually copy the files, but this seems indicative of something screwed up.
Please give this a review and tell me where I have messed up. Thank you!
The text was updated successfully, but these errors were encountered: