2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-28 15:45:46 +03:00

Temporary add support for VS2015 in old gradle.

This commit is contained in:
Lev 2017-03-09 19:59:14 +05:00
parent 46bf6e7af1
commit 505e739921
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
}