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 PIC Option #1041

Closed
wants to merge 2 commits into from
Closed

CMake PIC Option #1041

wants to merge 2 commits into from

Conversation

johnpatek
Copy link

For static build, new option ZLIB_BUILD_PIC would enable position independent code for the static library. I have set it to OFF as a default. I noticed there was an issue filed #21, which was again mentioned in #831.

@Vollstrecker
Copy link
Contributor

Why don't you just do cmake <PATH_TO_SOURCE> -DCMAKE_POSITION_INDEPENDENT_CODE=ON

@johnpatek
Copy link
Author

Why don't you just do cmake <PATH_TO_SOURCE> -DCMAKE_POSITION_INDEPENDENT_CODE=ON

My initial testing was incorrect, I have deleted my other comments. Your solution works for submodules.

@johnpatek johnpatek closed this Feb 6, 2025
@johnpatek johnpatek deleted the static-pic-build branch February 6, 2025 10:54
@johnpatek johnpatek restored the static-pic-build branch February 6, 2025 10:54
@Vollstrecker
Copy link
Contributor

So if it works, why 4 additional lines to get it working?

@johnpatek
Copy link
Author

So if it works, why 4 additional lines to get it working?

I agree, that's why my PR is closed.

My initial concern was about building zlib from a submodule, but I tested your solution and it works fine for that. Thanks for reviewing this.

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

Successfully merging this pull request may close these issues.

2 participants