The following environment was tested on multiple Windows environments with Ubuntu 22.04.4 LTS on WSL.
- Install WSL 2
- Update your package manager with
sudo apt-get update && sudo apt-get upgrade
- Install MinGW with
sudo apt-get install mingw-w64
- Install make with
sudo apt-get install make
- Install cmake with
sudo apt-get install cmake
NOTE: Always use WSL to build the project!
cd
into one of the projects (server or client), likecd server
- Run
cmake . --toolchain=../tc-winwin.cmake
(see footnote for more info). - Run
make
to build the project. - Run the server with
./server.exe
.
The following environment was tested on a MacBook Pro (2019) environment version 12.6 with the Homebrew package manager.
- Ensure you have XCode Tools version 12.3 installed. You'll need an Apple Developer account. This is to get access to the OpenGL framework and framework headers.
- Install glew with
brew install glew
- Install MinGW with
brew install mingw-w64
- Install CMake with
brew install cmake
If you've compiled for Windows, remove the CMake cache first by running rm -rf CMakeCache.txt CMakeFiles
cd
into one of the projects (server or client), likecd server
- Run
cmake . --toolchain=../tc-osx.cmake
(see footnote for more info). - Run
make
to build the project. - Run the server with
./server.exe
.
As a developer on Mac, it may be useful to know if your code will even compile on Windows. To check, follow these instructions.
If you've compiled for Mac, remove the CMake cache first by running rm -rf CMakeCache.txt CMakeFiles
cd
into one of the projects (server or client), likecd server
- Run
cmake . --toolchain=../tc-macwin.cmake
(see footnote for more info). - Run
make
to build the project. - If the program compiles, there is no further action needed, and there's a good chance the program will compile on a native Windows machine. You will be unable to run the generated
server.exe
executable, but in theory, you would be able to copy the .exe file to a Windows machine and it will run.
* What's up with --toolchain?
The --toolchain flag tells CMake to use the specified toolchain with our custom toolchain file, for example, tc-osx.cmake, where it will use clang and clang++ to compile the files, with the libraries and frameworks specified in the toolchain file. Each environment has its own toolchain: for compiling on Windows: tc-winwin.cmake; for compiling on Mac with a Windows target: tc-macwin.cmake; for compiling on Mac with a Mac target: tc-osx.cmake