gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
92 stars 8 forks source link

Add method to get Native Compiler for a binary #991

Open ThadHouse opened 5 years ago

ThadHouse commented 5 years ago

Currently, there is no method without using internals to get the native compiler or toolchain for a native binary. There are many use cases for this. The first is if you need to run a task that requires a tool from the toolchain. One of the biggest could be things like checking for a correct pattern in a disassembled function, or things like checking shared library dependencies to make sure things are correct. Both of these require access to tools that are part of the toolchain (dumpbin for windows, nm, read-elf and objdump) for windows.

The other use case is tooling. Being able to generate tooling for IDEs like VS Code and compile_command.json requires access to the toolchain and all of its arguments in order to provide that information to the IDE.