Merge pull request #395 from dreamstalker/gradle_vs2015

Temporary add support for VS2015 in old gradle.
This commit is contained in:
Lev 2017-03-09 20:21:38 +05:00 committed by GitHub
commit fb0c81aec9
2 changed files with 21 additions and 0 deletions

4
getucrtinfo.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
call "%VS140COMNTOOLS%vcvarsqueryregistry.bat"
echo %UniversalCRTSdkDir%
echo %UCRTVersion%

View File

@ -119,5 +119,22 @@ rootProject.ext.createMsvcConfig = { boolean release, BinaryKind binKind ->
}
}
// Detect and setup UCRT paths
def ucrtInfo = "getucrtinfo.bat".execute().text
def m = ucrtInfo =~ /^(.*)\r\n(.*)?$/
if (!m.find()) {
return cfg
}
def kitPath = m.group(1)
def ucrtVersion = m.group(2)
def ucrtCheckFile = new File("${kitPath}Include/${ucrtVersion}/ucrt/stdio.h");
if (!ucrtCheckFile.exists()) {
return cfg
}
cfg.compilerOptions.args "/FS", "/I${kitPath}Include/${ucrtVersion}/ucrt";
cfg.linkerOptions.args("/LIBPATH:${kitPath}Lib/${ucrtVersion}/ucrt/x86");
return cfg
}