Skip to content

VCPKG_KEEP_ENV_VARS only works on Linux #42064

Answered by ASxa86
ASxa86 asked this question in Q&A
Discussion options

You must be logged in to vote

If it helps others in the future. While I don't know why this worked on Linux. The official vcpkg documentation states VCPKG_KEEP_ENV_VARS is to be defined as an environment variable.

Therefore, the solution is to use the environment key to define the values instead of the cacheVariables.

{
    "version": 6,
    "configurePresets": [
        {
            "name": "target-arm64-android",
            "hidden": true,
            "cacheVariables": {
                "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/toolchains/android.cmake",
                "VCPKG_TARGET_TRIPLET": "arm64-android-aspire",
                "VCPKG_INSTALL_OPTIONS": "--allow-unsupported;--debug-env",
  …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ASxa86
Comment options

You must be logged in to vote
1 reply
@ASxa86
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants