APP_TARGET or TARGET_PLATFORM

1,708 views
Skip to first unread message

Athos Bacchiocchi

unread,
Mar 8, 2012, 9:13:12 AM3/8/12
to andro...@googlegroups.com
I'm using ndk-r7b. If I want to specify the target platform for my build, I read from the docs (ANDROID-MK) that I should set the TARGET_PLATFORM attribute in Android.mk.

But here:
http://groups.google.com/group/android-ndk/browse_thread/thread/4005dbff9725dc92
I read i should set the APP_TARGET attribute in Application.mk, but this is not clearly documented anywhere in the docs.

Which one is the correct way?

Another couple of questions:
1) If i don't specify any target platform, the builder will choose the one indicated in project.properties, won't it?
2) What happens if i build my library for a higher android platform than the one set on the "java" side?

thanks,
athos

David Turner

unread,
Mar 8, 2012, 11:33:57 AM3/8/12
to andro...@googlegroups.com
On Thu, Mar 8, 2012 at 3:13 PM, Athos Bacchiocchi <at...@ntrack.com> wrote:
I'm using ndk-r7b. If I want to specify the target platform for my build, I read from the docs (ANDROID-MK) that I should set the TARGET_PLATFORM attribute in Android.mk.

That's not what the documentation says. TARGET_PLATFORM will be defined for you when your Android.mk is parsed.
By default, the target API level is extracted from your project.properties file, but the value will be overridden if you define APP_PLATFORM in your Application.mk (see docs/APPLICATION-MK.html)
 
But here:
http://groups.google.com/group/android-ndk/browse_thread/thread/4005dbff9725dc92
I read i should set the APP_TARGET attribute in Application.mk, but this is not clearly documented anywhere in the docs.


This is not documented because this relies on internal behaviour of ndk-build that probably changed since this post was written. Please ignore this.
 
Which one is the correct way?

Another couple of questions:
1) If i don't specify any target platform, the builder will choose the one indicated in project.properties, won't it?

Yes
 
2) What happens if i build my library for a higher android platform than the one set on the "java" side?

You will have more system headers available when building your machine code, and you can also link against more system libraries.
However, your shared library will fail to load on older systems because its dependencies won't be available.

This feature is intended for people who know what they're doing, and would only open a "newer" system library through dlopen()

- David

thanks,
athos

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Athos Bacchiocchi

unread,
Mar 8, 2012, 11:51:59 AM3/8/12
to andro...@googlegroups.com
Il 08/03/2012 17:33, David Turner ha scritto:
On Thu, Mar 8, 2012 at 3:13 PM, Athos Bacchiocchi <at...@ntrack.com> wrote:
I'm using ndk-r7b. If I want to specify the target platform for my build, I read from the docs (ANDROID-MK) that I should set the TARGET_PLATFORM attribute in Android.mk.

That's not what the documentation says. TARGET_PLATFORM will be defined for you when your Android.mk is parsed.
sorry, I misunderstood that sentence because of my poor english.


By default, the target API level is extracted from your project.properties file, but the value will be overridden if you define APP_PLATFORM in your Application.mk (see docs/APPLICATION-MK.html)

There's no reference to APP_PLATFORM in APPLICATION-MK.html
(anyway my subject is wrong... i wrote APP_TARGET, but I meant APP_PLATFORM).

Thanks for your help!
athos
Reply all
Reply to author
Forward
0 new messages