Make sure you have installed
- Visual Studio
- Make sure C++ related packages are selected during the installation
- CMake
- Make sure it is available on the command line / PATH if given the option during installation
- Git SCM
- Make sure it is available on the command line / PATH if given the option during installation
Note it is highly recommended that you should not use the windows version of emscripten. Because of line ending differences, the generated output files will most likely not work once they are uploaded to a web server. To avoid this issue, use Emscripten on a Linux based OS like Ubuntu or MacOS.
-
Read through their Platform-specific notes to see if you need to do anything for your platforms, like install python3.
-
Go to a directory where you would like to put the Emscripten tools and run the following:
# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
# Download and install the SDK tools.
./emsdk install 3.1.53
# Make this version active" for the current user. (writes .emscripten file)
./emsdk activate 3.1.53
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.shYou will need GNU and related development tools, like make and git.
sudo apt install build-essential git cmake libsdl2-dev libglew-devXcode is the integrated development environment (IDE) for macOS. It includes the necessary tools and compilers for C++ development.
-
Open the App Store on your Mac.
-
Search for "Xcode" and install it.
-
Launch Xcode once the installation is complete to complete the setup process.
-
Open Terminal (you can find it in Applications > Utilities or use Spotlight).
-
Run the following command to install Command Line Tools:
xcode-select --install
-
Follow the on-screen instructions to complete the installation.
-
Install Homebrew (if not already installed):
Homebrew is a popular package manager for macOS. It simplifies the process of installing various software packages, including CMake.
Checkout how to install it here https://brew.sh
-
Install CMake, SDL2, and GLEW using Homebrew:
With Homebrew installed, you can easily install CMake from the terminal:
brew install cmake sdl2 glew
Homebrew will download and install the latest versions for you.