File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
ir-printer-gradle-plugin/src/main/java/com/bennyhuo/kotlin/ir/printer/gradle Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 11kotlin.code.style =official
22
3- VERSION_NAME =2.0.0-1.1.6
3+ VERSION_NAME =2.0.0-1.1.7
44
55GROUP =com.bennyhuo.kotlin
66
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ open class PrinterExtension {
2424
2525 var isEnabled: Boolean = true
2626 var isLlvmIrEnabled: Boolean = true
27+ var llvmDisPath: String? = null
2728 var indent: String = " "
2829 var outputDir: String? = null
2930 var outputType: OutputType = OutputType .RAW_IR
Original file line number Diff line number Diff line change @@ -41,15 +41,22 @@ class IrPrinterGradlePlugin : KotlinCompilerPluginSupportPlugin {
4141 target is KotlinNativeTarget
4242 ) {
4343 val konanTempDir = kotlinCompilation.getOrConfigKonanTempDir()
44- val konanConfig = KonanConfig (project)
45-
46- // force llvm variant to dev to obtain the llvm-dis binary file.
47- kotlinCompilation.compileTaskProvider.get().compilerOptions.freeCompilerArgs.add(" -Xllvm-variant=dev" )
48- println (" LLVM variant is set to dev for disassembling LLVM bitcode." )
49-
50- // lazily resolve this path after Kotlin Native compiler setup.
51- val llvmDisPathLazy = lazy {
52- File (konanConfig.llvmHome, " bin/llvm-dis" ).absolutePath
44+
45+ val userConfiguredLlvmDisPath = extension.llvmDisPath
46+ val llvmDisPathLazy = if (userConfiguredLlvmDisPath.isNullOrBlank()) {
47+ val konanConfig = KonanConfig (project)
48+
49+ // force llvm variant to dev to obtain the llvm-dis binary file.
50+ kotlinCompilation.compileTaskProvider.get().compilerOptions.freeCompilerArgs.add(" -Xllvm-variant=dev" )
51+ println (" LLVM variant is set to dev for disassembling LLVM bitcode." )
52+
53+ // lazily resolve this path after Kotlin Native compiler setup.
54+ lazy {
55+ File (konanConfig.llvmHome, " bin/llvm-dis" ).absolutePath
56+ }
57+ } else {
58+ println (" Use user configured llvm-dis in '$userConfiguredLlvmDisPath ' for disassembling LLVM bitcode." )
59+ lazy { File (userConfiguredLlvmDisPath).absolutePath }
5360 }
5461
5562 target.binaries.forEach { binary ->
You can’t perform that action at this time.
0 commit comments