Tobbi {l Wrote}:Yes, please do so! This helps us improve the build process. Thanks!
Earlier attempts, mostly just a list of my mistakes: Right. So the first thing I did (and the first mistake I made) was to download the repository as a zip. Then (I had never used cmake before, only heard of it) so I had to figure out that it was a program I needed to install. Next I tried the 'cmake ..' command, but got lots of errors; cmake couldn't find ANY of the dependencies or external libraries. Like i said, I've never used cmake before, but looking through CMakeLIsts.txt, it sure looks like it's supposed to find those folders on it's own; I put the dependencies folder just where INSTALL.md said to. Anyway, I slowly specified each file path (after figuring out that cmake doesn't use the regular environment variables and I had to use -Dxxx=<filepath> in the command) and figured out that the 'external' libraries didn't download in the zip with everything else, so I added them one by one too.
Finally, there was just one error left, cmake couldn't find the version number. Apparently those used the git version (or so I gathered from CMakeLists.txt and version.cmake.in) so eventually I tried starting over with a properly cloned repo. I still had to specify each and every path to .libs and include directories, but eventually I actually got it to configure and generate the makefiles without errors or warnings.
Of course... I don't know if that guarantees that I gave it the right file paths, or if it was just satisfied that I had given it some filepath for each required library. But at any rate, I could open the solution in Visual Studio 2017. I'm pretty sure that cmake was targeting the right compiler (the 2017 VS one) but I still can't build the entire solution. Many of the individual projects (squirrel, physfs) will build without so much as a warning, but if I try to build the entire thing (or one of the 'supertux2' projects) things don't go so well:
I get hundreds of C4244 warnings, about converting from dobule to float or something very similar
Also common, but much less so, is 'Unknown compiler version - please run the configure tests and report the results'
A few rare warnings (there doubtless are others I missed):
- warning C4068: unknown pragma
- 7>C:\Users\samth\Documents\supertux\src\video\drawing_context.cpp(263): warning C4291: 'void *operator new(::size_t,obstack &)': no matching operator delete found; memory will not be freed if initialization throws an exception
- 7>C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\corecrt_math_defines.h(22): warning C4005: 'M_PI': macro redefinition (compiling source file C:\Users\samth\Documents\supertux\src\supertux\menu\keyboard_menu.cpp)
- C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\memory(1384): note: see reference to function template instantiation 'std::_Ref_count_obj<_Ty>::_Ref_count_obj<Vector&,int,int,int,int,Vector,int,Color&,double,double,int>(Vector &,int &&,int &&,int &&,int &&,Vector &&,int &&,Color &,double &&,double &&,int &&)' being compiled
with
[
_Ty=Particles
]
Finally, I suddenly get 202 errors. As far as I can see, they are all from supertux2.lib, and all say 'unresolved external symbol' followed by something like '_SDL_RenderReadPixels' or '_ov_pcm_tell.' These are followed up by about a dozen warnings: "warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86'," coming from the dependency libraries.
...
Ok, that actually explains a lot of the problems. Apparently my system information lied to me, and i should have gotten the x32 dependeny package. Which explains why cmake couldn't find anything, it expected to find things in a directory called dependencies32. Let me try this one more time.
Today's attempt, this time with the right dependencies package: Right off the bat things look much better, the only library cmake can't find is physfs. It also has these two concerning looking lines:
-- Looking for vorbis_bitrate_addblock in vorbis - not found
-- Performing Test HAVE_ICONV_CONST - Failed
But apparently these aren't fatal errors; they aren't even mentioned next time i try the command. I set PHYSFS_INCLUDE_DIR and PHYSFS_LIBRARY both to an absolute path to external\physfs\src (since I can't find any .lib or .so files for physfs) and cmake runs without errors or warnings.
Open the solution with visual studio aaaaaand... what do you know. I'm still swamped in warnings, but it finishes without errors. run_supertux.bat doesn't work though, whether I build in release or debug. It says it can't find supertux.exe, even though it exists in the debug/release folder. If I try to run the exe directly it says it can't find squirrel.dll. I'm too tired of this to figure it out today.
TL;DRFor the most part I got it to work after all, there are just lots of warnings, I had to specify paths to physfs, and run_supertux.bat doesn't work (or i just don't know how to use it). I suppose the next step would be trying to run the "configure tests," wherever those are, so I can "report the results" like the warnings asked me to.