mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.75k stars 439 forks source link

Compilation on macOS fails when targeting GLES (ANGLE) #541

Closed ak-jpanneton closed 2 years ago

ak-jpanneton commented 2 years ago

When I try to compile Magnum from source with ANGLE on macOS, I'm getting the following error:

/Users/user/Git/Build/Magnum/magnum/src/Magnum/GL/Implementation/driverSpecific.cpp:488:8: error: 
      use of undeclared identifier 'renderer'
    if(renderer.contains("ANGLE"_s))
       ^
/Users/user/Git/Build/Magnum/magnum/src/Magnum/GL/Implementation/driverSpecific.cpp:521:8: error: 
      use of undeclared identifier 'renderer'
    if(renderer.contains("SwiftShader"_s))
       ^

In fact, in driverSpecific.cpp, renderer is only declared if CORRADE_TARGET_APPLE is not defined. Then, renderer is being used only if MAGNUM_TARGET_GLES is defined (no matter if CORRADE_TARGET_APPLE is defined or not). This causes renderer to be undeclared on macOS when targeting GLES.

mosra commented 2 years ago

Hi! I was wondering if you received my e-mail reply from two weeks ago as I didn't get anything back ... but given the context of this issue, you probably did :)

Sorry about this error, it was caused by recent changes which apparently weren't picked up by the ANGLE-on-Mac-using projects yet. To avoid this regressing again in the future, I added a dedicated CI job for Mac GLES builds in 031d1ceec36b9afb64c71a09495c8c746b750f0b, and subsequently fixed this and some other wrong assumptions about Mac being always desktop GL in c36ed5e61dda54616899731ef53da1783c2d5c79 and 0964ddbf0c37fc8859bbe0f840ca5376cad9944b.

While I'm not aware of any Mac-specific ANGLE issues, let me know in case you run into something strange that's not happening on other platforms.

ak-jpanneton commented 2 years ago

I'm really sorry about the late email reply. I thought I did reply to you, but it seems like my message was still laying in my draft folder... It's sent now! Thanks for the quick fix.

mosra commented 2 years ago

No problem :)