Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
This commit is contained in:
+5
-1
@@ -134,7 +134,7 @@ open class KotlinNativeBinaryContainer @Inject constructor(
|
||||
internal fun defaultTestExecutable(
|
||||
configure: Executable.() -> Unit
|
||||
) = createBinaries(
|
||||
"test",
|
||||
DEFAULT_TEST_NAME_PREFIX,
|
||||
"test",
|
||||
NativeOutputKind.EXECUTABLE,
|
||||
listOf(DEFAULT_TEST_BUILD_TYPE),
|
||||
@@ -144,8 +144,12 @@ open class KotlinNativeBinaryContainer @Inject constructor(
|
||||
configure
|
||||
)
|
||||
|
||||
internal fun getDefaultTestExecutable(): Executable =
|
||||
getExecutable(DEFAULT_TEST_NAME_PREFIX, DEFAULT_TEST_BUILD_TYPE)
|
||||
|
||||
companion object {
|
||||
internal val DEFAULT_TEST_BUILD_TYPE = NativeBuildType.DEBUG
|
||||
internal val DEFAULT_TEST_NAME_PREFIX = "test"
|
||||
|
||||
internal fun generateBinaryName(prefix: String, buildType: NativeBuildType, outputKindClassifier: String) =
|
||||
lowerCamelCaseName(prefix, buildType.getName(), outputKindClassifier)
|
||||
|
||||
+5
@@ -664,6 +664,11 @@ open class KotlinNativeTargetConfigurator(
|
||||
}
|
||||
}
|
||||
}
|
||||
// Allow setting linker options for the default test executable using the
|
||||
// corresponding properties of the test compilation.
|
||||
target.binaries.getDefaultTestExecutable().apply {
|
||||
linkerOpts.addAll(target.compilations.getByName(TEST_COMPILATION_NAME).linkerOpts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user