Skip to content

Ghidra is a software reverse engineering (SRE) framework

Speeding up windows build.

Ryan Kurtz748e7c3e2b26
diff --git a/GPL/nativeBuildProperties.gradle b/GPL/nativeBuildProperties.gradle
index e18a8ffc27..1b70a513ee 100644
--- a/GPL/nativeBuildProperties.gradle
+++ b/GPL/nativeBuildProperties.gradle
@@ -25,32 +25,6 @@ project.ext.VISUAL_STUDIO_VCVARS_CMD = "UNKNOWN"
project.ext.MSVC_SDK_VERSION = "UNKNOWN"
project.ext.MSVC_TOOLS_VERSION = "UNKNOWN"
-if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
-
- project.ext.VISUAL_STUDIO_INSTALL_DIR = project.ext.VISUAL_STUDIO_BASE_DIR + "\\Professional"
- if (!file(project.ext.VISUAL_STUDIO_INSTALL_DIR).exists()) {
- project.ext.VISUAL_STUDIO_INSTALL_DIR = project.ext.VISUAL_STUDIO_BASE_DIR + "\\Community"
- }
- if (file(project.ext.VISUAL_STUDIO_INSTALL_DIR).exists()) {
-
- println "Visual Studio Path: ${VISUAL_STUDIO_INSTALL_DIR}"
-
- project.ext.VISUAL_STUDIO_VCVARS_CMD = "\"${VISUAL_STUDIO_INSTALL_DIR}\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x86_amd64"
-
- // NOTE: Windows 7 targeting requires the use of the Windows 8.1 SDK and setting the
- // WINVER property a value of "0x0601" which may be specified to the compiler/linker.
- // If using a VS Solution this must be specified within the project file(s).
- project.ext.WINVER = "0x0601"
-
- // Rely on vcvars script to supply SDK versions
- def COMMAND = "cmd /c ${VISUAL_STUDIO_VCVARS_CMD} > nul && cmd /c echo"
- project.ext.MSVC_SDK_VERSION = "${COMMAND} %WINDOWSSDKVERSION%".execute().text.trim().replace('\\', '')
- println "Visual Studio SDK Version: ${MSVC_SDK_VERSION}"
- project.ext.MSVC_TOOLS_VERSION = "${COMMAND} %VCTOOLSVERSION%".execute().text.trim().replace('\\', '')
- println "Visual Studio VCTools Version: ${MSVC_TOOLS_VERSION}"
- }
-}
-
/****************************************************************************
* Defines the platforms we have to support in Ghidra. This model is used
* for all native builds and should be extended by each module as-needed.
@@ -85,11 +59,34 @@ task CheckToolChain {
// Native C/Cpp plugins will trigger failure if no tool chain found
doFirst {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
+
+ project.ext.VISUAL_STUDIO_INSTALL_DIR = project.ext.VISUAL_STUDIO_BASE_DIR + "\\Professional"
+ if (!file(project.ext.VISUAL_STUDIO_INSTALL_DIR).exists()) {
+ project.ext.VISUAL_STUDIO_INSTALL_DIR = project.ext.VISUAL_STUDIO_BASE_DIR + "\\Community"
+ }
+ if (file(project.ext.VISUAL_STUDIO_INSTALL_DIR).exists()) {
+
+ println "Visual Studio Path: ${VISUAL_STUDIO_INSTALL_DIR}"
+
+ project.ext.VISUAL_STUDIO_VCVARS_CMD = "\"${VISUAL_STUDIO_INSTALL_DIR}\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x86_amd64"
+
+ // NOTE: Windows 7 targeting requires the use of the Windows 8.1 SDK and setting the
+ // WINVER property a value of "0x0601" which may be specified to the compiler/linker.
+ // If using a VS Solution this must be specified within the project file(s).
+ project.ext.WINVER = "0x0601"
+
+ // Rely on vcvars script to supply SDK versions
+ def COMMAND = "cmd /c ${VISUAL_STUDIO_VCVARS_CMD} > nul && cmd /c echo"
+ project.ext.MSVC_SDK_VERSION = "${COMMAND} %WINDOWSSDKVERSION%".execute().text.trim().replace('\\', '')
+ println "Visual Studio SDK Version: ${MSVC_SDK_VERSION}"
+ project.ext.MSVC_TOOLS_VERSION = "${COMMAND} %VCTOOLSVERSION%".execute().text.trim().replace('\\', '')
+ println "Visual Studio VCTools Version: ${MSVC_TOOLS_VERSION}"
+ }
+
// ensure that required MS Visual Studio is installed where expected
String msg = "Microsoft Visual Studio install not found: ${VISUAL_STUDIO_BASE_DIR}\n" +
"Adjust path in Ghidra/GPL/nativeBuildProperties.gradle if needed."
- if (!file(VISUAL_STUDIO_BASE_DIR).exists() ||
- !file(VISUAL_STUDIO_INSTALL_DIR).exists()) {
+ if (!file(VISUAL_STUDIO_BASE_DIR).exists() || !file(VISUAL_STUDIO_INSTALL_DIR).exists()) {
throw new GradleException(msg);
}
}
diff --git a/Ghidra/Features/Decompiler/build.gradle b/Ghidra/Features/Decompiler/build.gradle
index e175f7b354..a4f7130ca2 100644
--- a/Ghidra/Features/Decompiler/build.gradle
+++ b/Ghidra/Features/Decompiler/build.gradle
@@ -80,7 +80,6 @@ task buildDecompilerDocumentationPdfs(type: Exec) {
// Check the OS before enabling task.
if (!(org.gradle.internal.os.OperatingSystem.current().isLinux()
|| org.gradle.internal.os.OperatingSystem.current().isMacOsX())) {
- println "The '$it.name' task only works on Linux or Mac Os X and is therefore disabled."
it.enabled = false
}