build/gradle/cli compiler flags usage fix (#2045)
This commit is contained in:
committed by
Nikolay Igotti
parent
20d3520717
commit
66732675e5
@@ -170,7 +170,7 @@ targetList.each { target ->
|
|||||||
if (target != "wasm32") defaultArgs += '-g'
|
if (target != "wasm32") defaultArgs += '-g'
|
||||||
def konanArgs = [*defaultArgs,
|
def konanArgs = [*defaultArgs,
|
||||||
'-target', target,
|
'-target', target,
|
||||||
'-Xruntime', project(':runtime').file("build/${target}/runtime.bc"),
|
"-Xruntime=${project(':runtime').file('build/' + target +'/runtime.bc')}",
|
||||||
*project.globalBuildArgs]
|
*project.globalBuildArgs]
|
||||||
|
|
||||||
task("${target}Stdlib", type: JavaExec) {
|
task("${target}Stdlib", type: JavaExec) {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ project.rootProject.ext.platformManager.enabled.each { target ->
|
|||||||
libraries {
|
libraries {
|
||||||
klibs df.config.depends
|
klibs df.config.depends
|
||||||
}
|
}
|
||||||
extraOpts '--purge_user_libs'
|
extraOpts '-Xpurge-user-libs'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -120,7 +120,7 @@ open class KotlinNativeCompile @Inject constructor(internal val binary: Abstract
|
|||||||
addArg("-l", library.nameWithoutExtension)
|
addArg("-l", library.nameWithoutExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
addListArg("-linkerOpts", linkerOpts)
|
addListArg("-linker-options", linkerOpts)
|
||||||
|
|
||||||
addAll(sources.files.map { it.absolutePath })
|
addAll(sources.files.map { it.absolutePath })
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -117,7 +117,7 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec {
|
|||||||
// The library's directory is added in libraries.repos.
|
// The library's directory is added in libraries.repos.
|
||||||
addArgs("-library", libraries.artifacts.map { it.artifact.nameWithoutExtension })
|
addArgs("-library", libraries.artifacts.map { it.artifact.nameWithoutExtension })
|
||||||
|
|
||||||
addFileArgs("-nativelibrary", nativeLibraries)
|
addFileArgs("-native-library", nativeLibraries)
|
||||||
addArg("-produce", produce.name.toLowerCase())
|
addArg("-produce", produce.name.toLowerCase())
|
||||||
|
|
||||||
addListArg("-linkerOpts", linkerOpts)
|
addListArg("-linkerOpts", linkerOpts)
|
||||||
@@ -132,7 +132,7 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec {
|
|||||||
addKey("-nomain", noMain)
|
addKey("-nomain", noMain)
|
||||||
addKey("-opt", enableOptimizations)
|
addKey("-opt", enableOptimizations)
|
||||||
addKey("-ea", enableAssertions)
|
addKey("-ea", enableAssertions)
|
||||||
addKey("--time", measureTime)
|
addKey("-Xtime", measureTime)
|
||||||
addKey("-nodefaultlibs", noDefaultLibs)
|
addKey("-nodefaultlibs", noDefaultLibs)
|
||||||
addKey("-Xmulti-platform", enableMultiplatform)
|
addKey("-Xmulti-platform", enableMultiplatform)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ open class KonanCompilerDownloadTask : DefaultTask() {
|
|||||||
if (downloadDependencies) {
|
if (downloadDependencies) {
|
||||||
val runner = KonanCompilerRunner(project, project.konanExtension.jvmArgs)
|
val runner = KonanCompilerRunner(project, project.konanExtension.jvmArgs)
|
||||||
project.konanTargets.forEach {
|
project.konanTargets.forEach {
|
||||||
runner.run("--check_dependencies", "-target", it.visibleName)
|
runner.run("-Xcheck_dependencies", "-target", it.visibleName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.native.interop.gen.jvm.interop
|
|||||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||||
|
|
||||||
private const val NODEFAULTLIBS = "-nodefaultlibs"
|
private const val NODEFAULTLIBS = "-nodefaultlibs"
|
||||||
private const val PURGE_USER_LIBS = "--purge_user_libs"
|
private const val PURGE_USER_LIBS = "-Xpurge-user-libs"
|
||||||
|
|
||||||
// TODO: this function should eventually be eliminated from 'utilities'.
|
// TODO: this function should eventually be eliminated from 'utilities'.
|
||||||
// The interaction of interop and the compler should be streamlined.
|
// The interaction of interop and the compler should be streamlined.
|
||||||
@@ -45,7 +45,7 @@ fun invokeInterop(flavor: String, args: Array<String>): Array<String> {
|
|||||||
noDefaultLibs = true
|
noDefaultLibs = true
|
||||||
if (arg == PURGE_USER_LIBS)
|
if (arg == PURGE_USER_LIBS)
|
||||||
purgeUserLibs = true
|
purgeUserLibs = true
|
||||||
if (arg == "--temporary_files_dir")
|
if (arg == "-Xtemporary-files-dir")
|
||||||
temporaryFilesDir = nextArg ?: ""
|
temporaryFilesDir = nextArg ?: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,9 +86,9 @@ fun invokeInterop(flavor: String, args: Array<String>): Array<String> {
|
|||||||
|
|
||||||
val nativeStubs =
|
val nativeStubs =
|
||||||
if (flavor == "wasm")
|
if (flavor == "wasm")
|
||||||
arrayOf("-includeBinary", File(nativesDir, "js_stubs.js").path)
|
arrayOf("-include-binary", File(nativesDir, "js_stubs.js").path)
|
||||||
else
|
else
|
||||||
arrayOf("-nativelibrary",File(nativesDir, "$cstubsName.bc").path)
|
arrayOf("-native-library",File(nativesDir, "$cstubsName.bc").path)
|
||||||
|
|
||||||
val konancArgs = arrayOf(
|
val konancArgs = arrayOf(
|
||||||
generatedDir.path,
|
generatedDir.path,
|
||||||
@@ -96,7 +96,7 @@ fun invokeInterop(flavor: String, args: Array<String>): Array<String> {
|
|||||||
"-o", outputFileName,
|
"-o", outputFileName,
|
||||||
"-target", target.visibleName,
|
"-target", target.visibleName,
|
||||||
"-manifest", manifest.path,
|
"-manifest", manifest.path,
|
||||||
"--temporary_files_dir", temporaryFilesDir) +
|
"-Xtemporary-files-dir=$temporaryFilesDir") +
|
||||||
nativeStubs +
|
nativeStubs +
|
||||||
cinteropArgsToCompiler +
|
cinteropArgsToCompiler +
|
||||||
libraries.flatMap { listOf("-library", it) } +
|
libraries.flatMap { listOf("-library", it) } +
|
||||||
|
|||||||
Reference in New Issue
Block a user