Precompiled headers in gradle experimental plugin.

87 views
Skip to first unread message

Adrian Lis

unread,
Dec 21, 2016, 11:29:05 PM12/21/16
to android-ndk
Hello,

I've searched with no success. Does gradle experimental plugin (currently I am using 0.9-beta1) support precompiled headers? If so how to enable them? Normally using gradle I would just use:

sources { cpp { preCompiledHeader "pch.h" [...]

but this obviously does not work with the gradle plugin. Or is using precompiled headers in NDK not recommended, if yes why?

Also are there any changelogs or docs anywhere besides this: http://tools.android.com/tech-docs/new-build-system/gradle-experimental webpage which is kind of out-of-date? Its hard to guess what is actually changing.

Thanks for any help in advance

Eric Lam

unread,
Feb 3, 2017, 8:04:47 PM2/3/17
to android-ndk
I've been searching on this topic to no avail as well (I'm on gradle-experimental:0.8.3).

I've been able to generate a pch by creating a pre-build task and using 'clang++ -cc1 -emit-pch ... '. But getting ndk to use this pch (need to use -include-pch, but that again requires a -cc1 flag as well) is where I am stuck.

The way forward seems to be going with cmake + AS 2.2 + stable gradle...


Anyways, I don't really have a solution, but I wanted to chime in and say I'm in the same boat as you. I'm interested if anybody else has any experience/recommendations in this area.
Reply all
Reply to author
Forward
0 new messages