Skip to content

Ghidra is a software reverse engineering (SRE) framework

Allow Gradle to use VS Build Tools

Xiaoyin Liu80e6bf0456ab
diff --git a/GPL/nativeBuildProperties.gradle b/GPL/nativeBuildProperties.gradle
index f83073e35b..730829463e 100644
--- a/GPL/nativeBuildProperties.gradle
+++ b/GPL/nativeBuildProperties.gradle
@@ -52,6 +52,13 @@ model {
}
}
}
+ if (isCurrentWindows()) {
+ // specify installDir because Gradle doesn't find VS Build Tools.
+ // See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
+ visualCpp(VisualCpp) {
+ installDir VISUAL_STUDIO_INSTALL_DIR
+ }
+ }
}
}
diff --git a/GPL/vsconfig.gradle b/GPL/vsconfig.gradle
index 915b90ea90..d6dae0ee5a 100644
--- a/GPL/vsconfig.gradle
+++ b/GPL/vsconfig.gradle
@@ -32,7 +32,7 @@ def configureVisualStudio() {
println "Visual Studio not found!"
return
}
- def vswhereOutput = "${vswherePath} -latest -format json".execute().text.trim()
+ def vswhereOutput = "${vswherePath} -products * -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json".execute().text.trim()
def vswhereJson = new groovy.json.JsonSlurper().parseText(vswhereOutput);
if (vswhereJson.isEmpty()) {
println "Visual Studio not found!"