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

Cmake 32bit Perimeters? #3

Open
KMFDManic opened this issue Dec 29, 2024 · 5 comments
Open

Cmake 32bit Perimeters? #3

KMFDManic opened this issue Dec 29, 2024 · 5 comments

Comments

@KMFDManic
Copy link

@diekleinekuh It was nice to discover that you had put together this Libretro wrapper for a Core. I typically work more so with Makefiles than Cmake. If it isn't too much trouble, do you have recommended Cmake commands to generate a libretro-build-miyoo-arm32 build? Thanks so much:) Looking forward to testing this out!

@diekleinekuh
Copy link
Owner

diekleinekuh commented Jan 3, 2025

Hi! Testing this on arm is also on my todo list but I don't own any 32 bit raspberry PIE or similar anymore, only 64 bit. Had to google what miyoo is. Googling turned out this. It seems the docker image has cmake installed so after doing make shell I guess the normal cmake flow would be roughly:

  1. clone BennuGD_libretro and change to the cloned directory
  2. create a build directory and change to it
  3. run cmake ./.. to configure the project and generate a native build environment
  4. run cmake --build . to compile and link the project

I didn't test the instructions above myself so they will probably not work out of the box. Also I didn't run any compile for this yet on 32bit so there is probably some minor things here or there in the code that need fixing.

If I find some time I can test it myself. Thanks for testing.

@diekleinekuh
Copy link
Owner

diekleinekuh commented Jan 6, 2025

I tried to build for miyoo-arm32 using this: https://github.com/shauninman/union-miyoomini-toolchain

There are some issues though.

  1. The version of cmake included in the docker image is too old. I was then downloading the current version from here:
    https://cmake.org/download/ after calling make shell. I had to call bash -r to make sure the manually installed version of cmake is picked up.
  2. I created a toolchain file matching the cross compiler locations in the docker image. It looked like this:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_SYSROOT /opt/miyoomini-toolchain/arm-linux-gnueabihf/sysroot/)

set(CMAKE_C_COMPILER /opt/miyoomini-toolchain/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /opt/miyoomini-toolchain/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

The file can be put into the workspace folder the docker image works in. I use my_toolchain_file.cmake as filename.
3. Then you have to replace step 3. in my previous post with:
cmake ./.. -DCMAKE_TOOLCHAIN_FILE=~/workspace/my_toolchain_file.cmake -DCMAKE_BUILD_TYPE=Release

It this enough to get you started?

It would be probably easier to make a newer docker image based on a newer debian or ubuntu version instead of downloading cmake manually. I can do this but I don't really know what your setup is and if this is a viable solution for your case.

@KMFDManic
Copy link
Author

@diekleinekuh Thanks for looking into this and responding back with your findings. I will see if anything you've said helps with getting it into a 32bit build. Up til this point, I have only been able to successfully run it 64bit wise. It would be quite nice for those with 32bit platforms to be able to enjoy this amazing game, too! Oddly enough, I was able to run a much "earlier" build of it via an older "modified" OpenBOR Build. But, that isn't what we are going for here! We want the real deal:) Thanks again!

@diekleinekuh
Copy link
Owner

I did get a 32 bit build with the toolchain inside of the docker container mentioned above. Couldn't test it though. Are you trying to get a standalone build of BennuGD or a libretro core? I defaulted to the libretro core one in the main CMakeLists.txt.

What game are you trying to run?

@KMFDManic
Copy link
Author

@diekleinekuh if you are able to drop the libretro.so build, id love to try it and see if it works. Was trying to run Streets of Rage remake. If there are any other worthwhile games that run on the engine, be sure to let me know:)

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