Return old behaviour for cinterop -output argument suffix handling

(accidentally changed in 976a9fc1)

 #KT-44824 Fixed.
This commit is contained in:
SvyatoslavScherbina
2021-02-18 21:24:45 +03:00
committed by Vasily Levchenko
parent 3f15774cb2
commit bea8edb10c
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverImpl
import org.jetbrains.kotlin.library.resolver.impl.libraryResolver
import org.jetbrains.kotlin.library.toUnresolvedLibraries
import org.jetbrains.kotlin.util.removeSuffixIfPresent
import org.jetbrains.kotlin.util.suffixIfNot
import java.io.File
import java.lang.IllegalArgumentException
import java.nio.file.*
@@ -376,15 +377,22 @@ private fun processCLib(flavor: KotlinPlatform, cinteropArguments: CInteropArgum
noDefaultLibs = true,
noEndorsedLibs = true
).getFullList()
val nopack = cinteropArguments.nopack
val outputPath = cinteropArguments.output.let {
val suffix = CompilerOutputKind.LIBRARY.suffix(tool.target)
if (nopack) it.removeSuffixIfPresent(suffix) else it.suffixIfNot(suffix)
}
createInteropLibrary(
metadata = stubIrOutput.metadata,
nativeBitcodeFiles = compiledFiles + nativeOutputPath,
target = tool.target,
moduleName = moduleName,
outputPath = cinteropArguments.output,
outputPath = outputPath,
manifest = def.manifestAddendProperties,
dependencies = stdlibDependency + imports.requiredLibraries.toList(),
nopack = cinteropArguments.nopack,
nopack = nopack,
shortName = cinteropArguments.shortModuleName,
staticLibraries = resolveLibraries(staticLibraries, libraryPaths)
)