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

A few questions? #1

Open
Zingam opened this issue Mar 3, 2020 · 5 comments
Open

A few questions? #1

Zingam opened this issue Mar 3, 2020 · 5 comments

Comments

@Zingam
Copy link

Zingam commented Mar 3, 2020

I do not understand the need for this:

arguments '-DANDROID_STL=c++_shared'

Can't we have static libraries?

You probably also need to add to the instructions to README (for the respective system Windows/ Linux/etc.) that this might be needed:

export ANDROID_NDK_HOME="/Library/Android/sdk/ndk/"

Also I guess this feature (as of today) is yet to be merged into master:
microsoft/vcpkg#10271

@atkawa7
Copy link
Owner

atkawa7 commented Mar 3, 2020

You are right

Also I guess this feature (as of today) is yet to be merged into master:
microsoft/vcpkg#10271

Current its doesn't support static libraries. It works similar to ndkports. It seems ndkports doesn't support static libs as well. I could be wrong. @DanAlbert https://android.googlesource.com/platform/tools/ndkports/+/refs/heads/master/src/main/kotlin/com/android/ndkports/PrefabPackageBuilder.kt#155

@Zingam
Copy link
Author

Zingam commented Mar 3, 2020

I wonder how this features will work for google/prefab#41 If I recall correctly I had issues integrating this library into my project as it might be build partly as static partly as dynamic. I don't really remember what was necessary to do.

OK. I found this comment in my build.gradle.kts file:

                //     When linking a static SDL2 library to a shared library SDL_main gets stripped
                //     thus we compile all libraries as static and link them with:
                //       $<$<PLATFORM_ID:Android>:-Wl,--whole-archive>
                //       GunBox_Engine_main
                //       $<$<PLATFORM_ID:Android>:-Wl,--no-whole-archive>
                arguments.add("-D.UseSharedLibrary_SDL2:BOOL=${Deps.sdl2_BuildAsShared}")

Also I think as of SDL2.10 modifications to the CMakeLists.txt were necessary, etc..

@atkawa7
Copy link
Owner

atkawa7 commented Mar 3, 2020

I don't know what's needed on the prefab side to support static libs. But vcpkg supports both static and shared libs

@DanAlbert
Copy link

DanAlbert commented Mar 3, 2020

Prefab supports static libraries. ndkports doesn't currently ship any. For a static library, c++_shared and c++_static are treated identically.

Verifying library compatibility is fairly complicated, so best to just check the source if you want to understand its behavior.

@ylz-at
Copy link

ylz-at commented Jul 22, 2022

This solution is currently broken, see microsoft/vcpkg#25182

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

4 participants