Is there a way to share cinterop lib between two s...
# kotlin-native
d
Is there a way to share cinterop lib between two source sets?
dependsOn
doesn't work.
i
Currently cinterop libs are not bound to any source set, but they are bound to a compilation. So what do you want to achieve by using the same interop from several source sets? Are these source sets included in different compilations (or compilations of different targets)?
d
In a multiplatform project, I have a
core
mingw source set and then a
coreExt
mingw source set. The
coreExt
source set adds a few more external dependencies for interop between
core
and external stuff.
They are the same target just different source sets.
Hold on, I just understood what you're asking. Yes, they are compilations of different targets.
i
It seems you can just split
core
and
coreExt
code in separate Gradle modules and depend in
coreExt
on
core
. Could you share a link to your project?
d
It's
kgl-vulkan
,
kgl-glfw
and
kgl-glfw-vulkan
.
Lets just join both threads here.
glfw.h
conditionally exposes some vulkan related functions if the vulkan header is included or if
-DGLFW_INCLUDE_VULKAN
is defined.
I only want these functions to be available in
kgl-glfw-vulkan
, but
glfw.h
and
vulkan.h
are consumed in
kgl-glfw
and
kgl-vulkan
.
So I was thinking of merging
kgl-glfw-vulkan
into
kgl-glfw
and exposing it as a different target in the same module and do some cinterop magic.
i
Not sure if it is possible in the current schema. Let me think about it.