-
Notifications
You must be signed in to change notification settings - Fork 14
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
Upgraded build system to run cmake and build on modern windows. #8
Conversation
…build. Adapted the code to build and run under modern windows and visual studio. Removed Boost. Added a Dirint implementation that runs under Windows
…mplain about auto_ptr
Updated: I ported everything to work on Linux (ubuntu) by using github actions. Linux version will be built automatically in actions, but i cant run it for testing myself. |
Made the scripts automatically download SDL. This makes the project 1-click-compile on windows, and on linux you just apt-get the SDL libs. Too bad git decided to un-squash the commits. |
Do I need to install Visual Studio Community 2019 or something similar in order to build this code with CMake? |
@abagames Doesnt have to be the latest VS, 2017 would also work. To make it work you need to use the standalone cmake to generate a VS project. Its also possible to get it working on visual studio code if you have the cmake extension installed. Then you can open the project directly in Vscode and get it building. The executable will be added to the cmake build folder you specified, and gotta copy the DLLs there manually. (the new DLLs, not the current ones on the root of the project which are old ones). The binaries will be generated under the folder build/bin/Debug/ (or Release). And SDL and mixer are downloaded under the build/libs folder, to grab the DLLs from them. |
I am not familiar with CMake, can you tell me how to build rr.exe? I installed Build Tools for Visual Studio 2019 and ran 'cmake .' in the root directory of the repository. Some files were generated, but rr.exe does not seem to be generated. |
I generally use the cmake GUI, but if you want touse the commandline, you can use the commands that the CI pipeline in github actions use, which are:
From the root folder of the project. That should compile rr.exe under the /bin/Release/folder. Should be completely automatic, dependencies like SDL are automatically installed. If you want to use the GUI instead (to edit parameters more easily, like build folder), then you can check this part of the vulkan tutorial i wrote. The scripts used for that tutorial are similar to the ones i used here, except they install SDL automatically. https://vkguide.dev/docs/chapter-0/building_project/ Keep in mind the rr.exe will default to 64 bit build, and will need the 64 bit DLLs. The SDL dlls are autodownloaded on the "libs" folder |
I entered the above command, but I got the following error. (It is inconvenient that the tool is localized so that messages are written in Japanese.)
The following is a translation into English.
Is there anything you can think of as a solution? Do I need to do something like 'make clean'? |
@abagames I havent seen that error with With CMakegui, you have to set source code folder, then build folder, and then click Configure and then Generate to create VS project. |
I understood.
With these steps I was able to build and run |
Im going to see if i can improve the cmake file a bit to make it easier. Should the .exe be generated in the root folder? That can be automatically done. |
I think it would be easier to build and run if all the necessary exe and dll files were placed in the root folder. |
Very well ill go modify it for that |
@abagames I tried a few ways, but wasnt happy with the result due to MSVC doing MSVC things. At the end, ive added a copy command to the build script. The executable will be created under the /bin/ folder, but after it compiles rr.exe, it will copy it into root folder automatically. It will also copy the DLLs. Only does the DLL copy on windows, on linux some of those DLLs might just be on system paths. The .exe is copied on both platforms. Let me know if thats alright with you. |
I was able to confirm that the exe and dll files are copied to the root folder in my environment. If everything is ok, I will merge this PR into the cmake branch. |
I'm also planning to add a brief description of how to build with cmake in the README. |
Build system moved into CMake. To build, just run cmake and make sure to set the SDLMIXER_PATH and SDL_PATH variables so that it can find SDL.
The cmake build files default to win64. I dont have linux so i cant check what to fix to make them build on linux.
Boost removed from bullet ML, code builds on Cpp14 now. boost::shared_ptr is swapped with std::shared_ptr
BulletML embedded into the project.
Dirint swapped with a windows capable version from https://github.com/tronkko/dirent (mit license). Removes the need for minGW.
The PR only changes the build, game code is left as-is, no changes to anything.
The PR is unfinished, i want to fix it to also build linux before it should get merged.
Ive created this commit as a release, so that its possible to try the compiled version https://github.com/vblanco20-1/rrootage/releases/tag/pr0.1