Browse Source

Fixing native code compilation

tags/light-jdk8u5+36
Ivan Dubrov 10 years ago
parent
commit
25ec3e2061
2 changed files with 8 additions and 4 deletions
  1. 7
    3
      build.gradle
  2. 1
    1
      native/compile.cmd

+ 7
- 3
build.gradle View File

} }


project('native') { project('native') {
apply plugin: 'base'
task compile(type: Exec) { task compile(type: Exec) {
if (root.os != Os.WINDOWS) {
doFirst {
buildDir.mkdirs()
}
if (os != Os.WINDOWS) {
commandLine 'gcc' commandLine 'gcc'
args "-I${jre}/../include" args "-I${jre}/../include"
args "-I${jre}/../include/linux" args "-I${jre}/../include/linux"
args '-o' args '-o'
args 'build/libnatives.so' args 'build/libnatives.so'
} else { } 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 environment JAVA_HOME: jre
} }
} }

+ 1
- 1
native/compile.cmd View File

set WINDOWS_SDK=c:\Program Files\Microsoft SDKs\Windows\v7.1 set WINDOWS_SDK=c:\Program Files\Microsoft SDKs\Windows\v7.1
call "%WINDOWS_SDK%\bin\setenv.cmd" /%ARCH% 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

Loading…
Cancel
Save