build/tests: implement passing interop linker args to compiler

This commit is contained in:
Svyatoslav Scherbina
2017-03-09 16:06:36 +07:00
committed by SvyatoslavScherbina
parent 7ad36ac035
commit 725e367614
2 changed files with 9 additions and 2 deletions
@@ -202,7 +202,12 @@ class RunInteropKonanTest extends KonanTest {
String interopStubsBc = new File(interopConf.nativeLibsDir, interop + "stubs.bc").absolutePath
runCompiler(filesToCompile, exe, ["-library", interopBc, "-nativelibrary", interopStubsBc])
List<String> linkerArguments = interopConf.linkerOpts // TODO: add arguments from .def file
List<String> compilerArguments = ["-library", interopBc, "-nativelibrary", interopStubsBc] +
linkerArguments.collectMany { ["-linkerArg", it] }
runCompiler(filesToCompile, exe, compilerArguments)
}
}
@@ -32,7 +32,7 @@ class NamedNativeInteropConfig implements Named {
private List<String> compilerOpts = []
private List<String> headers;
private String linker
private List<String> linkerOpts = []
List<String> linkerOpts = []
private FileCollection linkFiles;
private List<String> linkTasks = []
@@ -177,6 +177,8 @@ class NamedNativeInteropConfig implements Named {
// defer as much as possible
doFirst {
List<String> linkerOpts = this.linkerOpts
linkTasks.each {
linkerOpts += project.tasks.getByPath(it).outputs.files.files
}