From a1bb028e6bf1496922cb9a922bf4ef6862540594 Mon Sep 17 00:00:00 2001 From: Aaron Shelley Date: Mon, 12 Aug 2024 23:56:26 -0400 Subject: [PATCH] Use dynamic libraries for android. --- .devcontainer/devcontainer.json | 4 ++-- .devcontainer/postcreate.sh | 9 +++------ triplets/arm64-android-aspire.cmake | 5 +++++ triplets/x64-android-aspire.cmake | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b1c7e2a..76c4e10 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,13 +3,13 @@ "remoteEnv": { "NUGET_NAME": "gitlab", "NUGET_SOURCE": "https://gitlab.com/api/v4/projects/51467465/packages/nuget/index.json", - "VCPKG_VERSION": "2024.02.14", + "VCPKG_VERSION": "2024.07.12", "VCPKG_ROOT": "${containerWorkspaceFolder}/vcpkg", "VCPKG_BINARY_SOURCES": "clear;nuget,gitlab,readwrite", "GITLAB_USER": "${localEnv:GITLAB_USER}", "GITLAB_USER_TOKEN": "${localEnv:GITLAB_USER_TOKEN}", "WORKSPACE_DIR": "${containerWorkspaceFolder}", - "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/vcpkg:${containerWorkspaceFolder}/vcpkg/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin:${containerEnv:ANDROID_HOME}/cmdline-tools/latest/bin:${containerEnv:ANDROID_HOME}/platform-tools:${containerEnv:ANDROID_HOME}/emulator" + "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/vcpkg:${containerWorkspaceFolder}/vcpkg/downloads/tools/cmake-3.29.2-linux/cmake-3.29.2-linux-x86_64/bin:${containerEnv:ANDROID_HOME}/cmdline-tools/latest/bin:${containerEnv:ANDROID_HOME}/platform-tools:${containerEnv:ANDROID_HOME}/emulator" }, "runArgs": [ "--gpus", diff --git a/.devcontainer/postcreate.sh b/.devcontainer/postcreate.sh index 730fc81..b153095 100644 --- a/.devcontainer/postcreate.sh +++ b/.devcontainer/postcreate.sh @@ -10,14 +10,11 @@ fi ./vcpkg/vcpkg fetch nuget ./vcpkg/vcpkg fetch cmake -echo "mono ./vcpkg/downloads/tools/nuget-6.2.1-linux/nuget.exe sources add -source $NUGET_SOURCE -name $NUGET_NAME -username $GITLAB_USER -password $GITLAB_USER_TOKEN" -mono ./vcpkg/downloads/tools/nuget-6.2.1-linux/nuget.exe sources add -source $NUGET_SOURCE -name $NUGET_NAME -username $GITLAB_USER -password $GITLAB_USER_TOKEN - -echo "mono ./vcpkg/downloads/tools/nuget-6.2.1-linux/nuget.exe config -set maxHttpRequestsPerSource=64" -mono ./vcpkg/downloads/tools/nuget-6.2.1-linux/nuget.exe config -set maxHttpRequestsPerSource=64 +echo "mono ./vcpkg/downloads/tools/nuget-6.10.0-linux/nuget.exe sources add -source $NUGET_SOURCE -name $NUGET_NAME -username $GITLAB_USER -password $GITLAB_USER_TOKEN" +mono ./vcpkg/downloads/tools/nuget-6.10.0-linux/nuget.exe sources add -source $NUGET_SOURCE -name $NUGET_NAME -username $GITLAB_USER -password $GITLAB_USER_TOKEN sdkmanager "emulator" -sdkmanager "system-images;android-33;google_apis;x86_64" +sdkmanager "system-images;android-34;google_apis;x86_64" apt install -y libpulse-dev if [ ! -d "$WORKSPACE_DIR/avd" ]; then diff --git a/triplets/arm64-android-aspire.cmake b/triplets/arm64-android-aspire.cmake index 5a1681b..ae9236f 100644 --- a/triplets/arm64-android-aspire.cmake +++ b/triplets/arm64-android-aspire.cmake @@ -1,4 +1,9 @@ set(VCPKG_LIBRARY_LINKAGE static) + +if(${PORT} MATCHES "qt") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_CMAKE_SYSTEM_NAME Android) diff --git a/triplets/x64-android-aspire.cmake b/triplets/x64-android-aspire.cmake index 47d9218..41d8270 100644 --- a/triplets/x64-android-aspire.cmake +++ b/triplets/x64-android-aspire.cmake @@ -1,4 +1,9 @@ set(VCPKG_LIBRARY_LINKAGE static) + +if(${PORT} MATCHES "qt") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_CMAKE_SYSTEM_NAME Android)