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

Build flow and compiling: Improving compilation by utilizing mingw/make – can't find SDL #21

Open
RavenMacDaddy opened this issue Sep 12, 2022 · 15 comments

Comments

@RavenMacDaddy
Copy link

RavenMacDaddy commented Sep 12, 2022

@BlackPowerade and I are having a discussion over at the Scoop Games repository.

Scoop is a command-line installer – more commonly known as a package manager.

We're trying to figure out how to improve the compiling process of the emulator, particularly by using mingw or make in a GitHub Actions flow rather than python – but so far we're unable to get those methods to find SDL.


We're also trying to figure out how to make regex recognize the addition of a new compiled build, as well as the hash of the corresponding build, at the same time.

That would make us able to create a manifest for the emulator.

@trzy
Copy link
Owner

trzy commented Sep 12, 2022 via email

@RavenMacDaddy
Copy link
Author

Good, that gives us a more informed starting point - cheers.

@BlackPowerade
Copy link

BlackPowerade commented Sep 12, 2022

I already have the supporting libraries installed with mingw, including SDL. It even starts compiling.
The problem I am running into is getting GCC to include SDL. No matter what I set for
SDL_INCLUDE_DIR and SDL_LIB_DIR in https://github.com/trzy/Supermodel/blob/master/Makefiles/Makefile.Win32#L52,L53
It fails to find SDL.h.
It throws this error everytime:
image
Yet I know gcc can find the includes, it looks in them earlier:
image
SDL's include folder is properly populated:
image
And SDL files are present under libs:
image

It's possible to have supermodel be automatically built, I just need to figure out what the makefile wants. In the meantime, I'll see if I can get linux and MacOS builds going.

@trzy
Copy link
Owner

trzy commented Sep 12, 2022 via email

@BlackPowerade
Copy link

D:\msys64\mingw64\include\SDL2
D:\msys64\mingw64\lib

@trzy
Copy link
Owner

trzy commented Sep 12, 2022 via email

@BlackPowerade
Copy link

Found the issue. For some reason
https://github.com/trzy/Supermodel/blob/master/Makefiles/Makefile.Win32#L96 $(addprefix -I,$(sort $(PLATFORM_INCLUDE_DIR)))
Wasn't adding the paths to the compiler. I have them hard coded (for now) and now it has an issue with linking, but I think I can fix it. Will update later.

@BlackPowerade
Copy link

Running into issue with unicode and minGW's lack of some kind of support.
This https://stackoverflow.com/questions/58324230/undefined-reference-to-winmain-c-mingw says you only need to add -municode to the compiler options, but in doing so it now produces different errors about converting char* to LPCWSTR:
image
I'll keep going at it.

@ToBul
Copy link
Contributor

ToBul commented Sep 13, 2022

FWIW, I tried this a while ago and also found the GitHub VM file paths way too funky. There, but not there???
Edit.
Just need to change makefiles if using brew install. No big deal after all.

@BlackPowerade
Copy link

More news.
It took me some time before I finally remembered paths were case sensitive on *nix, but when I did Supermodel pretty much built without any problems. It throws some errors about format overflows, but still compiles and links. I'll take that as a win.
MacOS is a different story, without -Wno-error=implicit-function-declaration it fails in m68kcpu and m86kopnz.
image
With it, it fails in linking; complaining about not finding SDL, but that doesn't really make sense when it was able to find SDL.h...
image
Also thanks @ToBul, I've never used C, I would have never figured out the header stuff.

@ToBul
Copy link
Contributor

ToBul commented Sep 15, 2022

It throws some errors about format overflows

I had another go at this.
What looks like overflow errors is when you build with netboard but forget to amend SDL net #includes.
Once you do that it builds Win and Ubuntu cleanly and you can leave the Warning settings alone.
Hopefully this will go some way to helping OSX build too. ??

@RavenMacDaddy
Copy link
Author

Hey @ToBul, give yourself some credit.

I only know a bit about making manifests and barely see any logic in programming – that's why I wanted to put the right people in contact. :)

@ToBul
Copy link
Contributor

ToBul commented Sep 17, 2022

Edit.
Just need to change makefiles if using brew install. No big deal after all.

@trzy
Copy link
Owner

trzy commented Oct 11, 2022 via email

@BlackPowerade
Copy link

Yes, MSYS2 is being used. We can get supermodel to build on windows and linux in actions.
I've given up on getting MacOS builds for now though. I don't have a Mac to test it on, and I can't really replicate actions environment with docker.

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

4 participants