Skip to content

Commit 4c07cf9

Browse files
SvyatoslavScherbinaSpace Team
authored and
Space Team
committed
[K/N] Introduce ClangArgs.clangArgsForKonan(C|Cxx)Sources
There is `ClangArgs.clangArgsForKonanSources`, but it is specific to C++ (clang++) and fails to mention this in the name. This commit introduces two other properties to support the C case and make the distinction clear. It also makes public the language-agnostic part, `ClangArgs.clangArgsSpecificForKonanSources`, just to make things more flexible.
1 parent 1d7ea21 commit 4c07cf9

File tree

1 file changed

+8
-1
lines changed
  • native/utils/src/org/jetbrains/kotlin/konan/target

1 file changed

+8
-1
lines changed

native/utils/src/org/jetbrains/kotlin/konan/target/ClangArgs.kt

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sealed class ClangArgs(
3434
// TODO: Should be dropped in favor of real MSVC target.
3535
private val argsForWindowsJni = forJni && target == KonanTarget.MINGW_X64
3636

37-
private val clangArgsSpecificForKonanSources : List<String>
37+
val clangArgsSpecificForKonanSources: List<String>
3838
get() {
3939
val konanOptions = listOfNotNull(
4040
target.architecture.name.takeIf { target != KonanTarget.WATCHOS_ARM64 },
@@ -169,9 +169,16 @@ sealed class ClangArgs(
169169
else -> emptyArray()
170170
}
171171

172+
// Kept for compatibility, remove later.
172173
val clangArgsForKonanSources =
173174
clangXXArgs + clangArgsSpecificForKonanSources
174175

176+
val clangArgsForKonanCxxSources =
177+
(clangXXArgs + clangArgsSpecificForKonanSources).asList()
178+
179+
val clangArgsForKonanCSources =
180+
(clangArgs + clangArgsSpecificForKonanSources).asList()
181+
175182
private val libclangSpecificArgs =
176183
// libclang works not exactly the same way as the clang binary and
177184
// (in particular) uses different default header search path.

0 commit comments

Comments
 (0)