filament
filament copied to clipboard
Remove STL includes/types from public headers for gcc clients
Hi, I know whole project is build using Clang...right now for some reason I need to use gcc, is that possible or do you have any plan in the future that we can use gcc to build whole project? Sorry for bothering you.
You're not bothering us :) We'd love to be able to support gcc but we ran into many issues (most notably with gcc's STL) and could not afford to keep trying to fix them. We'd be happy to accept patches though (from you or anyone).
You could also try to use our binary releases. I haven't tested them with gcc but hopefully there are no issues there.
Just to add, I only had to Compile filament using Clang, but using GCC for my own projects that link against filament is fine. I assume using the binary releases should work just the same. The one thing you do need to consider is that you must use libc++ if you want to include any headers from the supporting libraries, e.g. filameshio as it exposes the stl. If you only plan on using the main filament library you should be able to get away with just linking against libc++ but you can use libstdc++ for the rest.
I have a couple of example projects: https://github.com/nitronoid/qt_filament https://github.com/nitronoid/qt_filament_pbr
Both are compiling fine with GCC, the latter uses filameshio and so I had to force GCC to use that too, but it's not too painful:
CXXFLAGS += -nostdinc++ -nodefaultlibs -isystem ${LIBSTDCPP_INCLUDE_PATH}
CXXFLAGS += -L${LIBSTDCPP_LIB_PATH} -lc -lc++ -lc++abi
LD_FLAGS += -L${LIBSTDCPP_LIB_PATH} -lc -lc++ -lc++abi
As a rule we shouldn't be exposing the STL in our public headers. Sounds like we should fix those. @pixelflinger @prideout
We've tried hard to not expose the STL in our public header. However, they did leak in a couple of places, and we've mostly done that work on libmath, libutils and libfilament -- other libraries got less attention in that regard. We'll keep improving this situation.