[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:
committed by
Space Team
parent
d85b23ebb9
commit
45de88abae
+5
-5
@@ -24,14 +24,14 @@ class StubIrContext(
|
||||
val plugin: Plugin
|
||||
) {
|
||||
val libraryForCStubs = configuration.library.copy(
|
||||
includes = mutableListOf<String>().apply {
|
||||
add("stdint.h")
|
||||
add("string.h")
|
||||
includes = mutableListOf<IncludeInfo>().apply {
|
||||
add(IncludeInfo("stdint.h", null))
|
||||
add(IncludeInfo("string.h", null))
|
||||
if (platform == KotlinPlatform.JVM) {
|
||||
add("jni.h")
|
||||
add(IncludeInfo("jni.h", null))
|
||||
}
|
||||
if (configuration.library.language == Language.CPP) {
|
||||
add("new")
|
||||
add(IncludeInfo("new", null))
|
||||
}
|
||||
addAll(configuration.library.includes)
|
||||
},
|
||||
|
||||
+3
-3
@@ -532,14 +532,14 @@ internal fun buildNativeLibrary(
|
||||
}
|
||||
|
||||
val compilation = CompilationImpl(
|
||||
includes = headerFiles,
|
||||
includes = headerFiles.map { IncludeInfo(it, null) },
|
||||
additionalPreambleLines = def.defHeaderLines + predefinedMacrosRedefinitions,
|
||||
compilerArgs = defaultCompilerArgs(language) + compilerOpts + tool.platformCompilerOpts,
|
||||
language = language
|
||||
)
|
||||
|
||||
val headerFilter: NativeLibraryHeaderFilter
|
||||
val includes: List<String>
|
||||
val includes: List<IncludeInfo>
|
||||
|
||||
val modules = def.config.modules
|
||||
|
||||
@@ -552,7 +552,7 @@ internal fun buildNativeLibrary(
|
||||
val headerInclusionPolicy = HeaderInclusionPolicyImpl(headerFilterGlobs, excludeFilterGlobs)
|
||||
|
||||
headerFilter = NativeLibraryHeaderFilter.NameBased(headerInclusionPolicy, excludeDependentModules)
|
||||
includes = headerFiles
|
||||
includes = headerFiles.map { IncludeInfo(it, null) }
|
||||
} else {
|
||||
require(language == Language.OBJECTIVE_C) { "cinterop supports 'modules' only when 'language = Objective-C'" }
|
||||
require(headerFiles.isEmpty()) { "cinterop doesn't support having headers and modules specified at the same time" }
|
||||
|
||||
Reference in New Issue
Block a user