Skip to content

Allow building static libs#183

Merged
hobu merged 1 commit intolibspatialindex:masterfrom
SpaceIm:allow-static-build
Mar 28, 2020
Merged

Allow building static libs#183
hobu merged 1 commit intolibspatialindex:masterfrom
SpaceIm:allow-static-build

Conversation

@SpaceIm
Copy link
Copy Markdown
Contributor

@SpaceIm SpaceIm commented Mar 27, 2020

closes #177

@SpaceIm
Copy link
Copy Markdown
Contributor Author

SpaceIm commented Mar 27, 2020

I'll force push another commit because SIDX_DLL and SIDX_C_DLL need refactoring (msvc with MTd and static lib is broken without those modifications).
I have a first draft with just few modifications which ask to consumer to define a macro if static and msvc.
A better approach would be to use CMake function GenerateExportHeader and more refactoring, thereby no need for consumer to define anything, and it will lead to better shared libs for other compilers than msvc.

@hobu hobu added this to the 2.0.0 milestone Mar 28, 2020
@hobu
Copy link
Copy Markdown
Member

hobu commented Mar 28, 2020

Can you please add a build scenario to the Azure pipelines that exercise a static build? It doesn't need to be part of this PR, but it is likely to rot otherwise.

@hobu hobu merged commit caee28d into libspatialindex:master Mar 28, 2020
@hobu
Copy link
Copy Markdown
Member

hobu commented Mar 29, 2020

I implemented cmake targets exports in #186 which I think you could use to implement GenerateExportHeader as well.

@SpaceIm SpaceIm deleted the allow-static-build branch August 17, 2022 09:16
@hobu hobu modified the milestones: 2.0.0, 2.1.0 Nov 20, 2024
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.

CMake: don't force the build of a shared library (the return)

2 participants