Skip to content

[BUG] ANDROID_NATIVE_API_LEVEL not work for NDK 23.1 new toolchain #1610

@huangqinjin

Description

@huangqinjin

Environment Details

  • NDK Version: 23.1.7779620
  • Build system: CMake 3.21 for new toolchain
  • Host OS: openSUSE tumbleweed
  • ABI: any
  • NDK API level: 25

Description

Run the following command for a minimal CMakeLists.txt:

cmake .. -DANDROID_NATIVE_API_LEVEL=25 -DCMAKE_TOOLCHAIN_FILE=/opt/android-sdk/ndk/${NDK}/build/cmake/android.toolchain.cmake -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=${LEGACY}
NDK=23.1.7779620; LEGACY=OFF # --- FAIL
-- ANDROID_PLATFORM not set. Defaulting to minimum supported version 16.
-- Android: Targeting API '16' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
NDK=23.1.7779620; LEGACY=ON # --- PASS
-- android-25 is an alias for android-24. Adjusting ANDROID_PLATFORM to match.
NDK=23.0.7599858; LEGACY=OFF # --- PASS
--         25 is an alias for         android-24.
-- Android: Targeting API '24' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
NDK=23.0.7599858; LEGACY=ON # --- PASS
-- android-25 is an alias for android-24. Adjusting ANDROID_PLATFORM to match.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions