AgreeableDeerGames / GameBackbone

2D game framework
MIT License
11 stars 4 forks source link

General Linux support #114

Closed lavinrp closed 6 years ago

lavinrp commented 7 years ago

Make things compile and run on linux

thingolober commented 7 years ago

There is a branch that is currently working for my machine using fedora. The code changes need to be tested on windows, and preferably this should be tested on another linux machine. I added a makefile which should compile everything into the demo.

gyurgyma commented 7 years ago

@Peaslek I've fixed your build on windows. However those hardcoded paths just won't do. Any idea why the relative paths wouldn't work?

lavinrp commented 7 years ago

@Peaslek @gyurgyma I've run into an issue like that before between Linux and windows. That was in python though.

Long story short python and windows treat the working directory differently.

Problem may also stem from the way that visual studio uses its project directory as the working dir? If the Linux exe isn't using GameBackboneSln as the working dir then things wont work.

Is the Linux exe in the GameBackboneExe folder?

side note: do we really need the double '/' in Linux? the 'R' before the string is supposed to make us not need those.

If we need the double '/' anyway we should remove the 'R'.

thingolober commented 7 years ago

@gyurgyma Whoops meant to change those hard coded paths.

@lavinrp I'll check the double slash usage. The demo is being built right now. In a new folder 'bld' in the root dir ov the project. What folder are you building it to?

lavinrp commented 7 years ago

@Peaslek because of the way visual studio works, The exe is not at the location that is considered the "working directory" when running the app from VS. When running in VS, no matter where the exe is output, the working directory is the directory of the project.

This means that, for all intents and purposes, our exe is at the top level of GameBackboneExe.

thingolober commented 7 years ago

This should be ready for review, the demo works fine although for some reason we receive errors about failing to load files that we did load..

@gyurgyma Can you try building in on windows again

lavinrp commented 7 years ago

@Peaslek Worked on windows. Have not tied on my Ubuntu yet.

thingolober commented 7 years ago

@lavinrp When trying on ubuntu note anything I left out on my small write up. It would probably be nice to document a set of commands for dependency installation on Ubuntu as that's the most popular distro.

gyurgyma commented 7 years ago

@Peaslek @lavinrp it works on my laptop. Imma say its passed michaels review. ensure it builds on linux ryan. then the tough part will be working with all of us to make sure we know what we can and cant do. Kyle, please make a list of general things we need to follow for style. I think thatll help out alot in the coming months while we learn to use that style inherently

lavinrp commented 6 years ago

Buckaroo and buck may be worth looking into to simplify our cross platform development.

I'm not sure I like buck (with it being tied to facebook), but a good cross platform build system and package manager would be nice.

The conan package manager may also be helpful.

thingolober commented 6 years ago

Just rewrite it in electron ezpz

gyurgyma commented 6 years ago

Somehow this conversation went from serious to useless in one single message

lavinrp commented 6 years ago

Here are some cmake tutorials that may help

https://www.codeproject.com/Articles/1181455/A-CMake-tutorial-for-Visual-Cplusplus-developers https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 https://schneide.wordpress.com/2016/04/08/modern-cmake-with-target_link_libraries/ https://schneide.wordpress.com/2017/11/06/4-tips-for-better-cmake/ https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html

lavinrp commented 6 years ago

I now have a trivial SFML app building with CMake in a way that is decently maintainable and will require 1/2 of the environment variables that we are currently using (could require 0 if 3rd party libs get installed into default locations).

I'll try to apply the same technique to GB and see if I can get it to work across all of GBs dependencies.

lavinrp commented 6 years ago

Something to consider for the future: We could avoid a bunch of headaches revolving around GCC not accepting a bunch of syntax that MSVC does and vice versa by using Clang on all platforms.

This would require windows users to download clang and the visual studio 2015 compiler suite (note that you can still use this with Visual Studio 2017)

I'm not entirely sure how that would behave with Cmake and visual studio, but its worth experimenting with.

lavinrp commented 6 years ago

https://github.com/lavinrp/Learn_Cmake_SFML

for cmake with sfml example

lavinrp commented 6 years ago

https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-To-Find-Libraries https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/dev/Improving-Find*-Modules

some documentation on how to make a find_gamebackbone.cmake

lavinrp commented 6 years ago

@gyurgyma I'm running into a problem and I dont know if its local, a problem with my cmake, or a problem with tgui's cmake.

Would you mind switching back to the cmake branch and testing if you can build in release mode? I can build in debug mode just fine, but in release mode I get an error saying that tgui.lib cant be found (but it says it looked in the place where tgui.lib is...)

lavinrp commented 6 years ago

Just a reminder that we should add versioning to cmake

lavinrp commented 6 years ago

@gyurgyma

Would be great if you could test on linux

gyurgyma commented 6 years ago

It works.