From 25ec3e2061f4e304f13923702354b75bb77e7809 Mon Sep 17 00:00:00 2001 From: Ivan Dubrov Date: Fri, 25 Apr 2014 16:08:45 -0700 Subject: [PATCH] Fixing native code compilation --- build.gradle | 10 +++++++--- native/compile.cmd | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 62692747..dae673ea 100644 --- a/build.gradle +++ b/build.gradle @@ -128,8 +128,12 @@ project('agent') { } project('native') { + apply plugin: 'base' task compile(type: Exec) { - if (root.os != Os.WINDOWS) { + doFirst { + buildDir.mkdirs() + } + if (os != Os.WINDOWS) { commandLine 'gcc' args "-I${jre}/../include" args "-I${jre}/../include/linux" @@ -138,8 +142,8 @@ project('native') { args '-o' args 'build/libnatives.so' } else { - commandLine 'compile.cmd' - environment ARCH: root.arch == Arch.X86 ? 'x86' : 'x64' + commandLine 'cmd', '/c', 'compile.cmd' + environment ARCH: arch == Arch.X86 ? 'x86' : 'x64' environment JAVA_HOME: jre } } diff --git a/native/compile.cmd b/native/compile.cmd index c1c4f9a8..dde609a5 100644 --- a/native/compile.cmd +++ b/native/compile.cmd @@ -1,4 +1,4 @@ set WINDOWS_SDK=c:\Program Files\Microsoft SDKs\Windows\v7.1 call "%WINDOWS_SDK%\bin\setenv.cmd" /%ARCH% -%VC%\bin\cl /I%JAVA_HOME%\include /I%JAVA_HOME%\include\win32 natives.c /Fenatives.dll /LD +cl /I%JAVA_HOME%\..\include /I%JAVA_HOME%\..\include\win32 natives.c /Febuild\natives.dll /LD -- 2.39.5