Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake needs position independant code switched on #200

Open
memecode opened this issue Dec 9, 2024 · 1 comment
Open

Cmake needs position independant code switched on #200

memecode opened this issue Dec 9, 2024 · 1 comment
Labels
question Further information is requested

Comments

@memecode
Copy link

memecode commented Dec 9, 2024

When I try and build using cmake and then use in my projects. It complains that -fPIC isn't turned on. This can be fixed by adding:
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

To the cmake file, up the top somewhere.

@sammycage sammycage added the question Further information is requested label Dec 13, 2024
@sammycage
Copy link
Owner

Yeah, that's the fix! The whole idea is to enable it whenever the compiler complains about needing -fPIC. If you're building from the command line, you can also just pass -D CMAKE_POSITION_INDEPENDENT_CODE=ON to cmake. That should sort it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants