Closed royshil closed 9 months ago
Using an OBJECT
library would probably be better, but alas CMake doesn't support them with universal (x86_64 and arm64) macOS targets, so we are kinda stuck with static libraries.
For some reason gcc
does not assume PIC automatically for static x86_64 builds, so this seems correct.
Thanks @PatTheMav !
One last thing, I'd prefer if the PR title and commit title would read something like:
Build plugin support library with PIC on Linux and BSD
It's more generic from a project POV (calling it "position-independent code" would be even better but probably run afoul of commit message limits).
Please squash your changes into logical units and ensure correct naming for all commits. Otherwise the PR looks good.
Description
Adding
-fPIC
on Linux when compiling thelibplugin-support.a
static lib, otherwise some Linux OSs build complain e.g.Motivation and Context
Fixing Linux build for OSs such as Fedora.
How Has This Been Tested?
Built on Mac, Windows and Linux (Ubuntu).
Types of changes
Effectively a bugfix?
Checklist: