I have no experience using the native tools but I think you can reference the
GccToolChainCustomisationIntegrationTest class in gradle-core.
In that test they are doing the following:
model {
toolChains {
${gcc.id} {
addPlatformConfiguration(new ArmArchitecture())
}
}
platforms {
arm {
architecture "arm"
}
i386 {
architecture "i386"
}
}
}
class ArmArchitecture implements TargetPlatformConfiguration {
boolean supportsPlatform(Platform element) {
return element.getArchitecture().name == "arm"
}
List<String> getCppCompilerArgs() {
["-m32", "-DFRENCH"]
}
List<String> getCCompilerArgs() {
["-m32", "-DFRENCH"]
}
List<String> getObjectiveCCompilerArgs() {
[]
}
List<String> getObjectiveCppCompilerArgs() {
[]
}
List<String> getAssemblerArgs() {
[]
}
List<String> getLinkerArgs() {
["-m32"]
}
List<String> getStaticLibraryArchiverArgs() {
[]
}
}
My guess is that you'll want to do something like that.
-- John
On Wednesday, March 5, 2014 at 8:44 PM, Xavier Ducrohet [via Gradle] wrote:
> Hey all,
>
> I'm looking at the native support to attempt to build the tools part of the
> Android SDK with gradle. We have a few small native tools that needs to be
> compile and we cross compile the windows version on linux using mingw32.
>
> I was wondering if that would be supported since it's (like?) gcc? also I've
> been looking for an example of cross compilation but there isn't any, and the
> PlatformConfigurableToolChain DSL reference isn't super helpful :\
>
> A quick pointer on how to define a cross compilation target would be awesome,
> thanks!
> Xav
>
>
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://gradle.1045684.n5.nabble.com/Sample-for-native-cross-compilation-tp5712413.html
>
> To start a new topic under gradle-dev, email
> [email protected]
> (mailto:[email protected])
> To unsubscribe from gradle-dev, click here
> (http://gradle.1045684.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1436218&code=am9obi5yLmVuZ2VsbWFuQGdtYWlsLmNvbXwxNDM2MjE4fDIyMTUyNjEzNQ==).
> NAML
> (http://gradle.1045684.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml)
>
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Sample-for-native-cross-compilation-tp5712413p5712414.html
Sent from the gradle-dev mailing list archive at Nabble.com.