Skip to content

C interop build integration support#29

Open
leodouglas wants to merge 9 commits intoJetBrains:mainfrom
leodouglas:feature/cinterop-support
Open

C interop build integration support#29
leodouglas wants to merge 9 commits intoJetBrains:mainfrom
leodouglas:feature/cinterop-support

Conversation

@leodouglas
Copy link

No description provided.

@leodouglas leodouglas changed the title cinterop support C interop build integration support Nov 14, 2025
@joffrey-bion joffrey-bion requested a review from Jeffset November 14, 2025 10:27
@joffrey-bion
Copy link
Collaborator

Hey! I'd like to thank you again for the effort and the reactivity. I'm not using a lot of sugar in my PR comments, so if something sounds harsh or direct at first glance, please read the text while imagining a gentle and polite tone 😄

I haven't finished reviewing by any means, but I figured it was worth doing a first pass quickly.

@joffrey-bion joffrey-bion self-requested a review November 17, 2025 14:16
Copy link
Collaborator

@joffrey-bion joffrey-bion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your updates! Here is another pass. Sorry for the delay, but also let's wait for @Jeffset to be back from vacation (end of January)


@SchemaDoc("C/Objective-C interop settings for native targets")
val cinterop: CinteropSettings by nested()
val cinterop: Map<String, CinteropModule> by value(default = emptyMap())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the keys in this map used for? If they don't serve any purpose from the user's perspective, I think we should just make this a list.

Copy link
Author

@leodouglas leodouglas Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @joffrey-bion, the original idea was to follow the pattern proposed in the Kotlin/Native documentation, where each cinterops declaration has its own alias, for example:

cinterops {
    val libcurl by creating {
        definitionFile.set(project.file("src/nativeInterop/cinterop/libcurl.def"))
        packageName("com.jetbrains.handson.http")
        compilerOpts("-I/path")
        includeDirs.allHeaders("path")
    }
}
cinterop:
  hello:
    defFile: 'src/nativeInterop/cinterop/libcurl.def'

In that model, using a map makes sense to allow identification by name.

That said, since this alias is not currently used anywhere, I agree there’s no practical benefit from the user’s perspective. We can simplify this and switch to a list.

@leodouglas
Copy link
Author

Thanks for your updates! Here is another pass. Sorry for the delay, but also let's wait for @Jeffset to be back from vacation (end of January)

Sure, @joffrey-bion, np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants