https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
r

rrva

11/27/2023, 10:22 PM
For cinterop, how do I create different .def files for different OS:es? On linux I need different compilerOpts with different include paths than on macOS. Also, is it OK to have
-I/usr/include
on a linux build or does this create conflicting headers with the toolchain konan brings? right now, I had to create a file
src/nativeInterop/cinterop/libvips.def
with the following contents for a linux build:
Copy code
headers =  glib-object.h vips/vips.h
compilerOpts =-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include -I/usr/include/x86_64-linux-gnu
linkerOpts = -lvips -lglib-2.0 -lgobject-2.0
this just feels a bit wrong to have to include
-I/usr/include
t

Timofey Solonin

11/27/2023, 10:40 PM
different compilerOpts with different include paths
Are the target-specific options what you are looking for?
r

rrva

11/27/2023, 10:59 PM
oh thanks