SFML / SFML-Website

Repository for the SFML website.
Other
22 stars 35 forks source link

Compiling from source on macOS: clang must be used and not gcc #152

Open saxbophone opened 2 years ago

saxbophone commented 2 years ago

The requirement to "use native compilers" is only mentioned in the instructions for cmake-gui, a tool which is not available on macOS, therefore this build requirement may be missed by those looking to build SFML on macOS with gcc: https://github.com/SFML/SFML/issues/1229#issuecomment-774532215

This won't trip up anyone who just runs cmake from command-line without deliberately overriding the compilers, however overriding the compilers by setting variables CC and CXX is common with cmake, there is no reason to expect it to not work when switching clang to gcc, two compilers which maintain a high degree of interface-compatibility with eachother as far as the build system is concerned (mostly identical option flags). So it will be useful to document that SFML is tied to clang on macOS.

eXpl0it3r commented 1 year ago

I believe it would make sense to have an info box or similar hinting that GCC isn't fully supported.

Doesn't help that /usr/bin/gcc and /usr/bin/g++ are just aliases for AppleClang... 😄

See also the discussions here:

Do you want to make a PR to add such a messaging?

saxbophone commented 1 year ago

Do you want to make a PR to add such a messaging?

Alas, I would but I've had a look at the documentation codebase and I'm a little lost on what file I need to edit. It appears to be a mixture of Doxygen-generated HTML and handwritten PHP. Guidance would be welcome.

barracuda156 commented 1 year ago

What should be done instead is to fix building with GCC.

eXpl0it3r commented 1 year ago

You don't need to comment on all related issues 😄

We haven't found a fix for the issues, so we're just trying to be transparent with the additional documentation.
If you find a fix, then we're more than happy to merge it. 🙂

saxbophone commented 1 year ago

so we're just trying to be transparent with the additional documentation.

Talking of which, did you end up documenting this requirement additionally in the "compiling from source" section, as I you suggested? I'd do it myself but I can't grok your docs build!

eXpl0it3r commented 1 year ago

No, I haven't gotten around to it. 😓

The tutorials are really just HTML, the PHP at the top and bottom can be ignored, nothing exotic to grok 😀

saxbophone commented 1 year ago

The tutorials are really just HTML, the PHP at the top and bottom can be ignored, nothing exotic to grok 😀

Ahhhh! Good to know, I thought it was some auto-generated Doxygen stuff or something more complex and difficult...

eXpl0it3r commented 1 year ago

Well, if it's part of the documentation, then yes, it's generated, you'd have to edit the C++ code. But the tutorials are HTML sprinkled with a bit of PHP

saxbophone commented 1 year ago

Well, if it's part of the documentation, then yes, it's generated, you'd have to edit the C++ code. But the tutorials are HTML sprinkled with a bit of PHP

Sounds like the documentation needs documentation 😅😜