[K/N] Fix for KT-48807
Make NS_FORMAT_ARGUMENT(A) a no-op in cinterop because our Clang doesn't support it for NSAttributedString.
This commit is contained in:
+1
-21
@@ -477,34 +477,14 @@ internal fun buildNativeLibrary(
|
||||
val compilerOpts: List<String> = mutableListOf<String>().apply {
|
||||
addAll(def.config.compilerOpts)
|
||||
addAll(tool.getDefaultCompilerOptsForLanguage(language))
|
||||
// We compile with -O2 because Clang may insert inline asm in bitcode at -O0.
|
||||
// It is undesirable in case of watchos_arm64 since we target armv7k
|
||||
// for this target instead of arm64_32 because it is not supported in LLVM 8.
|
||||
//
|
||||
// Note that PCH and the *.c file should be compiled with the same optimization level.
|
||||
add("-O2")
|
||||
// Allow throwing exceptions through generated stubs.
|
||||
add("-fexceptions")
|
||||
addAll(additionalCompilerOpts)
|
||||
addAll(getCompilerFlagsForVfsOverlay(arguments.headerFilterPrefix.toTypedArray(), def))
|
||||
addAll(when (language) {
|
||||
Language.C -> emptyList()
|
||||
Language.CPP -> emptyList()
|
||||
Language.OBJECTIVE_C -> {
|
||||
// "Objective-C" within interop means "Objective-C with ARC":
|
||||
listOf("-fobjc-arc")
|
||||
// Using this flag here has two effects:
|
||||
// 1. The headers are parsed with ARC enabled, thus the API is visible correctly.
|
||||
// 2. The generated Objective-C stubs are compiled with ARC enabled, so reference counting
|
||||
// calls are inserted automatically.
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
val compilation = CompilationImpl(
|
||||
includes = headerFiles,
|
||||
additionalPreambleLines = def.defHeaderLines,
|
||||
compilerArgs = compilerOpts + tool.platformCompilerOpts,
|
||||
compilerArgs = defaultCompilerArgs(language) + compilerOpts + tool.platformCompilerOpts,
|
||||
language = language
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user