thebracket/bgame

Building for Windows?

Opened this issue · 1 comments

I managed to get the master branch compiled for Linux on my Ubuntu 16.04 VM following your instructions, but I'd like to compile it for Windows to play on my host OS. How can I do that?

I see the win-toolchain.cmake file, but I'm unsure how to use it and didn't come across any documentation. I'm fluent on the command-line, but not with cmake/make.

edit: Based on this discussion (which I presume is you?), it looks like I need to modify the cmake command in setup-unix-build.sh to include -DCMAKE_TOOLCHAIN_FILE=../win-toolchain.cmake. Is that correct? I did that and I made some progress. However, cmake cannot find lua. Which is odd, since I did install liblua5.2-dev to make the Linux version and that compiled just fine.

This is definitely one of those issues that should be easier to resolve, which is something I'm working on. I'm actually waiting on a new laptop to arrive (my current Windows laptop is dying), and I'll give it a good once-over when I have it.

The Toolchain file is vestigial, and probably shouldn't be there anymore. It stemmed from an attempt to do cross-compilation (building the Windows version from Linux/Mac, where I tend to spend my time). It's probably possible, but I didn't get anywhere making it work. :-(

What I'm current doing is as follows:

  • I work in MSYS2, which has packages for CMake, GCC/G++, and the various dependencies (Boost, GLFW, Cereal, Lua, GLEW, CURL, OpenGL, GLM, Zlib) installed via pacman -S.
  • Use git to clone the repo, and make a build directory.
  • Use cmake -g"Unix Makefiles" ../src or similar to make a build folder.
  • make -j4 to build.
  • Copy the world_defs and game_assets folders into the build folder, and run noxfutura.exe.

That's far from ideal, and MSYS2 is not a pleasant environment to work in. I've largely figured out the magic to make things work with Visual Studio 2017 (including its package manager), so I'll be using that as soon as my laptop arrives.