Skip to content

[BUG] ANDROID_USE_LEGACY_TOOLCHAIN_FILE not preserved correctly #1921

@smeenai

Description

@smeenai

Description

android.toolchain.cmake adds ANDROID_USE_LEGACY_TOOLCHAIN_FILE to CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, so that its value is preserved in try_compile checks. However, that preservation is done after the _USE_LEGACY_TOOLCHAIN_FILE branch, which just does a return() in case you're using the legacy toolchain file, so we never actually preserve ANDROID_USE_LEGACY_TOOLCHAIN_FILE correctly. android-legacy.toolchain.cmake has its own set of CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, but it doesn't include ANDROID_USE_LEGACY_TOOLCHAIN_FILE, so that doesn't work either. This is a moot point right now because we default to using the legacy toolchain file anyway, but it may become relevant in the future.

Affected versions

r25, r26

Canary version

No response

Host OS

Linux, Mac, Windows

Host OS version

Any

Affected ABIs

armeabi-v7a, arm64-v8a, x86, x86_64

Build system

CMake

Other build system

No response

minSdkVersion

Any

Device API level

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions