diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 00000000000..09d78a6f1c1 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,16 @@ +import org.jetbrains.kotlin.CompileCppToBitcode + +// TODO: consider using some Gradle plugins to build and test + + +task compileHash(type: CompileCppToBitcode) { + name 'hash' +} + +task build { + dependsOn compileHash +} + +task clean << { + delete buildDir +} diff --git a/runtime/src/main/cpp/City.cpp b/common/src/hash/cpp/City.cpp similarity index 100% rename from runtime/src/main/cpp/City.cpp rename to common/src/hash/cpp/City.cpp diff --git a/runtime/src/main/cpp/Sha1.cpp b/common/src/hash/cpp/Sha1.cpp similarity index 100% rename from runtime/src/main/cpp/Sha1.cpp rename to common/src/hash/cpp/Sha1.cpp diff --git a/runtime/src/main/cpp/City.h b/common/src/hash/headers/City.h similarity index 100% rename from runtime/src/main/cpp/City.h rename to common/src/hash/headers/City.h diff --git a/runtime/src/main/cpp/Sha1.h b/common/src/hash/headers/Sha1.h similarity index 100% rename from runtime/src/main/cpp/Sha1.h rename to common/src/hash/headers/Sha1.h diff --git a/runtime/build.gradle b/runtime/build.gradle index 2923fa46d46..1cb729defdc 100644 --- a/runtime/build.gradle +++ b/runtime/build.gradle @@ -7,6 +7,9 @@ task build(type: CompileCppToBitcode) { name 'runtime' srcRoot file('src/main') + dependsOn ':common:compileHash' + compilerArgs '-I' + project.file('../common/src/hash/headers') // TODO: copy-pasted from 'common' + linkerArgs project.file('../common/build/hash.bc').path } task test { diff --git a/settings.gradle b/settings.gradle index fbd1ea6cbcd..04fc18c90ee 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,3 +4,4 @@ include ':Interop:Runtime' include ':InteropExample' include ':backend.native' include ':runtime' +include ':common'