[Qbs] Android API level

Alberto Mardegan mardy at users.sourceforge.net
Sat Jul 11 11:18:51 CEST 2020


Hi all,
  While trying to build one of my existing projects for Android, I was
getting a build error:

==============
In file included from
/home/mardy/Android/Sdk/ndk/20.1.5948944/sources/android/support/include/math.h:32:
/home/mardy/Android/Sdk/ndk/20.1.5948944/sources/cxx-stl/llvm-libc++/include/math.h:1330:93:
error: no member named 'log2f' in the global namespace
inline _LIBCPP_INLINE_VISIBILITY float       log2(float __lcpp_x)
_NOEXCEPT       {return ::log2f(__lcpp_x);}
...
==============

which seemed to be related to the Android API level declared [1].
Indeed, after adding the following lines to my project, it works:

==============
    Properties {

        condition: qbs.targetOS.contains("android")

        Android.ndk.platform: "android-21"

    }

    Depends {

        condition: qbs.targetOS.contains("android")

        name: "Android.ndk"

    }

==============

However, there are still a couple of issues not clear to me:

1) In share/qbs/modules/Android/ndk/ndk.qbs, the platform property is
either initialized to "android-19" or "android-21"; how come, then, that
in my project the compiler command line was using "16" as API level?

2) The automatically-generated Android manifest still reports
minSdkVersion="16". I guess I should file a bug for this?

Ciao,
  Alberto


[1]: According to another project where the same error was reported:
https://github.com/tensorflow/tensorflow/issues/20192


-- 
http://www.mardy.it - Geek in un lingua international


More information about the Qbs mailing list