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

Can I create a C# bindings using .Net while building a static gdal Library in MacOS #8636

Closed
huzaifacontour opened this issue Oct 31, 2023 · 4 comments
Assignees

Comments

@huzaifacontour
Copy link

huzaifacontour commented Oct 31, 2023

Expected behavior and actual behavior.

Gdal should build c# bindings with static libs also.
It's because of this line of code in gdal.cmake file,
if (BUILD_SHARED_LIBS)
add_subdirectory(swig)
endif ()
Can you explain the reason of it? It should be in the doc also.

Steps to reproduce the problem.

Build Gdal with BUILD_SHARED_LIBS=OFF

Operating system

Darwin - 22.6.0 - arm64

GDAL version and provenance

Configuring GDAL 3.7.2 with cmake 28.0-rc3

@rouault rouault self-assigned this Oct 31, 2023
rouault added a commit to rouault/gdal that referenced this issue Oct 31, 2023
@rouault
Copy link
Member

rouault commented Oct 31, 2023

Can you explain the reason of it? It should be in the doc also.

see #8637

@huzaifacontour
Copy link
Author

So is there anyway to use the static GDAL in csharp projects?

@rouault
Copy link
Member

rouault commented Oct 31, 2023

So is there anyway to use the static GDAL in csharp projects?

no, I don't thin so. you could try to remove the if (BUILD_SHARED_LIBS) , but I suspect that won't work. That might build, perhaps, but weird things could happen at runtime

@huzaifacontour
Copy link
Author

Okay thankyou, I think now only solution for this is to go for the dynamic libs.

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

No branches or pull requests

2 participants