SFML-Website icon indicating copy to clipboard operation
SFML-Website copied to clipboard

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

Open saxbophone opened this issue 3 years ago • 9 comments

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.

saxbophone avatar Jul 28 '22 22:07 saxbophone

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:

  • https://github.com/SFML/SFML/pull/1928
  • https://github.com/SFML/SFML/pull/2163

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

eXpl0it3r avatar Dec 14 '22 09:12 eXpl0it3r

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.

saxbophone avatar Dec 18 '22 19:12 saxbophone

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

barracuda156 avatar Aug 07 '23 11:08 barracuda156

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. 🙂

eXpl0it3r avatar Aug 07 '23 11:08 eXpl0it3r

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!

saxbophone avatar Aug 10 '23 17:08 saxbophone

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 😀

eXpl0it3r avatar Aug 11 '23 19:08 eXpl0it3r

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...

saxbophone avatar Aug 12 '23 20:08 saxbophone

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

eXpl0it3r avatar Aug 13 '23 15:08 eXpl0it3r

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 😅😜

saxbophone avatar Aug 16 '23 22:08 saxbophone