Chromium iOS build using third-party framework (generated by Kotlin)

34 views
Skip to first unread message

Hung Le

unread,
Jun 17, 2020, 5:30:48 PM6/17/20
to Chromium-dev
Hi,

I am building an iOS framework using Kotlin Multiplatform Library.  I used the following Kotlin tutorial as a guide: https://kotlinlang.org/docs/tutorials/native/apple-framework.html

The resulted framework's header file was generated and contained many "@end;". Note the trailing semicolon.

For example:

__attribute__((swift_name("KotlinInt")))
@interface AuthyInt : AuthyNumber
- (instancetype)initWithInt:(int)value;
+ (instancetype)numberWithInt:(int)value;
@end;

The build failed and showed the following errors:

error: unknown attribute 'swift_name' ignored [-Werror,-Wunknown-attributes]
__attribute__((swift_name("KotlinInt")))


error: extra ';' outside of a function is incompatible with C++98 [-Werror,-Wc++98-compat-extra-semi]
@end;
    ^

The Kotlin tutorial also displays the similar annotation in its header file, so I believe it's how Kotlin generates it.

I would appreciate any suggestion of how to handle this scenario.  Maybe a tweak in the C++ build config?

Thanks!

Takuto Ikuta

unread,
Jun 17, 2020, 5:37:08 PM6/17/20
to hung...@gmail.com, Chromium-dev

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/3ced0f8d-c610-4e26-89a4-e102eda03789o%40chromium.org.

Avi Drissman

unread,
Jun 17, 2020, 7:33:31 PM6/17/20
to tik...@chromium.org, hung...@gmail.com, Chromium-dev
Indeed.

If Kotlin is generating Objective-C code like this, it is wrong. @end should *not* have a semicolon, and they are wrong to generate it. Please file a bug with them to fix it.

The bit about the "swift_name" attribute, I dunno.

Avi

Reply all
Reply to author
Forward
0 new messages