Files
kotlin-fork/runtime/build.gradle
T
Alexander Gorshenev b4660d03a1 Initial .wasm file generation for the wasm32 target.
Some basic launcher.js and runtime.
2017-08-03 17:51:48 +03:00

52 lines
1.7 KiB
Groovy

/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.CompileCppToBitcode
// TODO: consider using some Gradle plugins to build and test
targetList.each { targetName ->
task("${targetName}Runtime", type: CompileCppToBitcode) {
name "runtime"
srcRoot file('src/main')
dependsOn ":common:${targetName}Hash"
dependsOn "${targetName}Launcher"
target targetName
compilerArgs '-I' + project.file('../common/src/hash/headers')
if (rootProject.hasProperty("${targetName}LibffiDir"))
compilerArgs '-I' + project.file(rootProject.ext.get("${targetName}LibffiDir") + "/include")
linkerArgs project.file("../common/build/$targetName/hash.bc").path
}
}
targetList.each { targetName ->
task("${targetName}Launcher", type: CompileCppToBitcode) {
name "launcher"
srcRoot file('src/launcher')
target targetName
compilerArgs '-I' + project.file('../common/src/hash/headers')
compilerArgs '-I' + project.file('src/main/cpp')
}
}
task hostRuntime(dependsOn: "${hostName}Runtime")
task clean {
doLast {
delete buildDir
}
}