Skip to content

Commit 1d7ea21

Browse files
SvyatoslavScherbinaSpace Team
authored and
Space Team
committed
[K/N][build] Use -Werror when compiling C or C++ in NativeInteropPlugin
Now that this compilation doesn't emit any warnings, this commit adds `-Werror` to it to prevent new warnings.
1 parent 42e8940 commit 1d7ea21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/interop/NativeInteropPlugin.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,15 @@ open class NativeInteropPlugin : Plugin<Project> {
263263
val cflags = cCompilerArgs +
264264
commonCompilerArgs +
265265
ignoreWarningFlags +
266+
"-Werror" +
266267
includeDirs.map { "-I${it.absolutePath}" } +
267268
hostPlatform.clangForJni.hostCompilerArgsForJni
268269

269270
flags(*cflags.toTypedArray(), "-c", "-o", ruleOut(), ruleInFirst())
270271
}
271272
(".cpp" to ".$obj") {
272273
tool(*hostPlatform.clang.clangCXX("").toTypedArray())
273-
val cxxflags = cppCompilerArgs + commonCompilerArgs + includeDirs.map { "-I${it.absolutePath}" }
274+
val cxxflags = cppCompilerArgs + commonCompilerArgs + "-Werror" + includeDirs.map { "-I${it.absolutePath}" }
274275
flags(*cxxflags.toTypedArray(), "-c", "-o", ruleOut(), ruleInFirst())
275276
}
276277
}

0 commit comments

Comments
 (0)