Skip to content
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

Building for Windows? #134

Open
toddjames opened this issue Aug 22, 2017 · 1 comment
Open

Building for Windows? #134

toddjames opened this issue Aug 22, 2017 · 1 comment
Assignees

Comments

@toddjames
Copy link

toddjames commented Aug 22, 2017

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.

@thebracket thebracket self-assigned this Aug 23, 2017
@thebracket
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants