ghidra/Ghidra/Features/PDB/buildNatives.gradle
Shawn Hoffman 37e74c253b win pdb: don't override PlatformToolset
The msvc toolset version recently bumped to 14.40.x.
See https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/
Ghidra was assuming the msvc toolset version would match the PlatformToolset version (which indicates binary compatibility), which is not correct.
PlatformToolset specified on msbuild commandline was overriding the value in the vcxproj, and not acting as a "default" value.
Just remove the explicit passing, it's handled by the vcxproj already.
2024-05-30 12:38:59 -07:00

59 lines
2.0 KiB
Groovy

/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Native build files are already applied in development mode (indicated by presence of the
// Generic project). Only need to apply them if we are in a distribution.
if (findProject(':Generic') == null) {
apply from: "../../../GPL/utils.gradle"
apply from: "../../../GPL/nativePlatforms.gradle"
apply from: "../../../GPL/nativeBuildProperties.gradle"
}
if ("win_x86_64".equals(getCurrentPlatformName())) {
String makeName = "win_x86_64PDBMake"
task(type: Exec, makeName) {
def projectPath = projectDir.toString()
def solutionBatchFilePath = projectPath + "/build/buildSolution.bat"
def projectPathWindows = projectPath.replace("/", File.separator)
def solutionPathWindows = "\"${projectPathWindows}\\src\\pdb\\pdb.sln\""
doFirst {
file("build/os/win_x86_64").mkdirs()
def windowsTargetPlatformVersion = VISUAL_STUDIO_SDK_VERSION_OVERRIDE ?: VISUAL_STUDIO_SDK_VERSION_DEFAULT
def msbuildCmd = "msbuild ${solutionPathWindows} /p:Configuration=Release /p:WindowsTargetPlatformVersion=${windowsTargetPlatformVersion}"
println "Executing: " + msbuildCmd
new File(solutionBatchFilePath).withWriter { out ->
out.println "call " + VISUAL_STUDIO_VCVARS_CMD
out.println msbuildCmd
}
}
doLast {
assert file("build/os/win_x86_64/pdb.exe").exists() : "Failed to build pdb.exe"
}
executable "cmd"
args "/c"
args solutionBatchFilePath.replace("/", File.separator)
}
}