Native binaries: implicitHeaders, static/shared libraries and objective-c


Multiple questions really, but somewhat remotely linked (upgraded to the latest Gradle version, so there have been some changes in the model):

  1. what is the exact use of implicitHeaders (as opposed to exportedHeaders)?

Basically my sources are: - src/<library>/cpp (sources) - src/<library>/include (internal headers) - include/library (public/api headers)

I’m doing cpp.exportedHeaders.srcDir “include/${library}”, which adds the correct /I or -I flag, but cpp.implicitHeaders.srcDir “src/${library}/include” doesn’t seem to do anything as far as the generated options.txt file is concerned…

  1. is there a way to have gradle only create static library versions of my components (NativeLibrarySpec) only, skipping the shared library variant?

This one is mostly because I have no use for shared libs in this project and it fills all gradle tasks/components outputs with lines I’d rather never see :slight_smile:

  1. how can I conditionally apply the objective-cpp plugin?

Basically in some of my libraries I have: - src/<library>/cpp (C++ sources) - src/<library>/objcpp (Objective-C++ sources)

In my Visual Studio solution, the .mm files are simply not built (obviously). Is there a way to mimick this behavior with Gradle? Basically I’d only want to build those when I’m targetting OS X or iOS… Right now I’m hitting a “Objective-C++ is not available on the Visual C++ toolchain” error.


(and still great to see native support in Gradle)

1 Like