PCemOnMac / PCemV17macOS

Port of the PCem PC emulator for macOS. Comes with OpenGL 3.0 support built-in
GNU General Public License v3.0
68 stars 14 forks source link

SDL2 path incorrect #15

Closed Shambler2 closed 3 years ago

Shambler2 commented 3 years ago

Hi All,

Very minor issue that I ran into while compiling the latest main on an M1 Mac.

System: Macbook Pro M1 Pre-requisites installed through ARM native version of homebrew (sdl2) wxmac compiled as per instructions

Compile fails due to SDL.h (and a few other related header files) not being in the correct path.

Worked around it by swapping out all angle bracketed header includes that contain <SDL2/*> for double quoted includes e.g. <SDL2/sdl.h> to "SDL.h". There was roughly 10 edits I had to make then it compiled fine, all were in files that interacted with wx-mac.

Not sure if anyone else came across this or its something down to the way I have my system set up.

Shambler2 commented 3 years ago

Opened pull request #16 with the changes I made to make it compile on my system - feel free to close this & the pull request if it causes issues anywhere else

kyr0 commented 3 years ago

Hi @Shambler2

thank you for the PR! Are you running Big Sur? I also commented on your PR. Now reading your issue again, I see that it might be arm target specific and only on mac, only when you use homebrew to install these? In this case we might want to add preprocessor statements around the new include paths that basically check for: APPLE and arm -- @kode54 did you maybe bump into the same issues? How did you install the SDL lib?

Shambler2 commented 3 years ago

Hi @kyr0 yes I'm running Big Sur (should have mentioned that, whoops).

From what I can see yes that may well be the case - It's unlikely the approach I suggested is the right one but wanted to put it out there anyway as a workaround for anyone who might run into the same issue I did but not know how to fix it.

I'd be keen to understand if this is something anyone else has run into whilst testing this though!

kode54 commented 3 years ago

Thought I'd mention, the reason that maybe the existing path didn't fail for me, was that I also have SDL2.framework installed to /Library/Frameworks/.