[K/N][KT-39120] Build platform libraries with -fmodules

Merge-request: KT-MR-8175
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-01-13 07:33:42 +00:00
committed by Space Team
parent d85b23ebb9
commit 45de88abae
35 changed files with 302 additions and 58 deletions
@@ -0,0 +1 @@
error: comparison of incompatible enums 'pod1.ForwardEnumPOD' and 'pod2.ForwardEnumPOD' is always unsuccessful
@@ -0,0 +1,9 @@
import pod1.*
import pod2.*
fun box(): String {
if (pod1.varPOD != pod2.ForwardEnumPOD.Value2POD)
return "OK"
else
return "FAIL"
}
@@ -0,0 +1,6 @@
enum class ForwardEnumPOD private constructor(value: Int) : Enum<ForwardEnumPOD>, CEnum {
var value: ForwardEnumPOD
@Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Int): ForwardEnumPOD
var varPOD: ForwardEnumPOD
@CCall(id = "knifunptr_pod10_varPOD_getter") get
@CCall(id = "knifunptr_pod11_varPOD_setter") set
@@ -0,0 +1,2 @@
language = Objective-C
modules = forwardEnum1
@@ -0,0 +1,5 @@
enum class ForwardEnumPOD private constructor(value: Int) : Enum<ForwardEnumPOD>, CEnum {
@ConstantValue.Int(value = 0) enum entry Value1POD
@ConstantValue.Int(value = 1) enum entry Value2POD
var value: ForwardEnumPOD
@Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Int): ForwardEnumPOD
@@ -0,0 +1,2 @@
language = Objective-C
modules = forwardEnum2
@@ -0,0 +1,5 @@
#include <Foundation/NSObjCRuntime.h>
typedef NS_ENUM (int, ForwardEnumPOD); // Actual definition of the enum follows in another module `forwardEnum2`
ForwardEnumPOD varPOD;
@@ -0,0 +1,6 @@
framework module forwardEnum1 {
umbrella header "forwardEnum1.h"
export *
module * { export * }
}
@@ -0,0 +1,6 @@
#include <Foundation/NSObjCRuntime.h>
typedef NS_ENUM (int, ForwardEnumPOD) { // There was forward definition of this enum in another module `forwardEnum1`
Value1POD,
Value2POD
};
@@ -0,0 +1,6 @@
framework module forwardEnum2 {
umbrella header "forwardEnum2.h"
export *
module * { export * }
}