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

MSVC: support building as static library #2169

Closed
wants to merge 1 commit into from

Conversation

tobiasdiez
Copy link
Contributor

Adds support for building flint as a static library using cmake.

Workaround for #2164 and might be the preferred option anyway in certain settings.

@albinahlback
Copy link
Collaborator

Sorry, but #2164 was caused because of some unsupported way of building FLINT?

So if you set BUILD_SHARED_LIBS to off when configuring CMake, it still builds a shared library?

@albinahlback
Copy link
Collaborator

To reiterate this, we do not maintain CMake to be perfect. Our CMake should work for Windows systems, but not more than that. It is not a replacement for our Autotools build system.

@tobiasdiez
Copy link
Contributor Author

So if you set BUILD_SHARED_LIBS to off when configuring CMake, it still builds a shared library?

No it builds a static library, which is actually the default, see https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html#variable:BUILD_SHARED_LIBS.

@tobiasdiez
Copy link
Contributor Author

tobiasdiez commented Jan 19, 2025

Our CMake should work for Windows systems, but not more than that.

I'm only using it for Windows to build flint before building sage as part of sagemath/sage#38872. The currently released version of flint has to many bugs on Windows to work but thanks to your recent bug fixes the unreleased version is working fine, at least with these changes here and #2156 (comment).

@albinahlback
Copy link
Collaborator

I'm confused. If building FLINT as a static library in CMake already works, why this PR?

@tobiasdiez
Copy link
Contributor Author

It works with this PR applied...

@albinahlback
Copy link
Collaborator

Okay, I suppose I get confused by the wording. This does not add support for static library builds, but rather fixes it?

@isuruf
Copy link
Member

isuruf commented Jan 19, 2025

This is also incomplete as downstream projects would have to add FLINT_STATIC_BUILD. #2170 is better

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.

3 participants