napperley
06/10/2019, 1:35 AMnapperley
06/10/2019, 1:40 AMDominaezzz
06/10/2019, 6:40 AMdepends=gtk3
to your glinegraph def file. Although you have to repeat all the other attributes too.
I'm assuming you intend to re-use the kotlin gtk definitions.napperley
06/10/2019, 6:52 AMnapperley
06/10/2019, 7:19 AMglg_cairo.h:31:1: error: unknown type name 'G_BEGIN_DECLS'
Tried appending glib/gmacros.h to the headers property in the glinegraph.def and gtk3.def files however the error still persists (the macro can't be found).napperley
06/10/2019, 7:29 AMnapperley
06/10/2019, 7:31 AMnapperley
06/10/2019, 7:33 AMsvyatoslav.scherbina
06/10/2019, 7:35 AMI have found that this is done automatically but only across modules. You can addAre you sure that addingto your glinegraph def file.depends=gtk3
depends
has any effect? IIRC, it shouldn’t work this way.napperley
06/10/2019, 7:37 AMDominaezzz
06/10/2019, 7:38 AMwindows
. It did have an effect on that case.svyatoslav.scherbina
06/10/2019, 7:44 AMI’ve only used it to depend on platform libraries. LikeAFAIK, cinterop library always depends on platform libraries, so. It did have an effect on that case.windows
depends
shouldn’t have any effect event in this case.svyatoslav.scherbina
06/10/2019, 7:47 AMWhat method would you suggest for easily managing C library dependencies in a Kotlin Native app?There is no build-in method for this. You can extract attributes configuration to a function in build script. Also there should be a way to make one cinterop library import declarations from other one instead of including a duplicate definition.
napperley
06/10/2019, 7:57 AMnapperley
06/10/2019, 7:59 AMnapperley
06/10/2019, 8:01 AMYou can extract attributes configuration to a function in build script. Also there should be a way to make one cinterop library import declarations from other one instead of including a duplicate definition.Sounds like these things are not yet designed/implemented (aka a possible issue to create in the Kotlin Native issue tracker).
svyatoslav.scherbina
06/10/2019, 8:47 AMWould that mean only a single def file has to be created?It doesn’t limit you to this.
Is there a API available for extracting attribute configuration from a def file?No. This is not required for the approach I suggested above.
svyatoslav.scherbina
06/10/2019, 9:09 AMAlso there should be a way to make one cinterop library import declarations from other one instead of including a duplicate definition.To achieve that, first cinterop library should be attached to a compilation that (transitively) depends on the second one.
napperley
06/10/2019, 9:32 AMDominaezzz
06/10/2019, 12:05 PM-DINCLUDE_MORE_FUNCTIONS
changes the header. So my second cinterop klib comes out empty. 😞.svyatoslav.scherbina
06/10/2019, 12:59 PMIs there a sample project that uses this technique?I’m not aware of such a project.
KN assumes the output is the same since the headers are the sameExactly. Feel free to open a ticket for this, especially if you can’t workaround it by splitting your header.
napperley
06/11/2019, 1:07 AMTo achieve that, first cinterop library should be attached to a compilation that (transitively) depends on the second one.Trying to visualise what this technique would look like. A pseudo example (preferably in Gradle Kotlin DSL form) would be helpful here. Can you please elaborate more on the technique in detail.
napperley
06/11/2019, 3:29 AM/home/napperley/idea_projects/glinegraph-demo/build/bin/linux/releaseExecutable/glinegraph-demo.kexe: error while loading shared libraries: libglg_cairo.so: cannot open shared object file: No such file or directory
napperley
06/11/2019, 3:32 AMnapperley
06/11/2019, 3:36 AMnapperley
06/11/2019, 3:41 AM~/glinegraph_cairo$ readelf -h libglg_cairo.so
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x2e00
Start of program headers: 64 (bytes into file)
Start of section headers: 64536 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 7
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
napperley
06/11/2019, 4:19 AMsvyatoslav.scherbina
06/11/2019, 7:48 AMIs there a way to have only the APIs in the glg_cairo.h file indexed?
headers
and headerFilter
pretend to do exactly this. Only explicitly required declarations from other headers would be included. To avoid this, you can wrap these other headers into an interop library and depend on it.
Is there a way to setup the LD_LIBRARY_PATH environment variable in Gradle when running a kexe? End up having to manually set the environment variable, and run the program outside Gradle.Yes. The task for running
kexe
should be a stadard Exec
task. Please refer to Gradle documentation for more details on setting environment for Exec
tasks.napperley
06/11/2019, 8:22 PMnapperley
06/11/2019, 8:26 PMnapperley
06/11/2019, 8:36 PM