Closed GalGR closed 4 years ago
Cool, thanks!
Actually, only the renderer needs it because it's linked statically into the shared library. Shared libraries are compiled in a pointer-independent fashion by default (whether CMake instructs the compiler to do so is controlled by the target property POSITION_INDEPENDENT_CODE).
I tried to compile with GCC 7.5.0 with the shared library target on, but the build failed because building the shared object required the object files to be compiled with the position independent code flag. I searched in google on how to enable this flag in CMake, and found this workaround. I don't know if it's a good solution or not, because it also compiles the examples with this flag on, so please refactor that change if needed.