MSBuild: Support building with clang-cl

This commit is contained in:
Stenzek
2023-08-21 22:38:55 +10:00
parent bf15d13eb7
commit 76b5b8ad06
15 changed files with 862 additions and 34 deletions

View File

@ -129,8 +129,8 @@ static LONG NTAPI ExceptionHandler(PEXCEPTION_POINTERS exi)
{
char line[1024];
DWORD written;
std::snprintf(line, countof(line), "Exception 0x%08X at 0x%p\n", exi->ExceptionRecord->ExceptionCode,
exi->ExceptionRecord->ExceptionAddress);
std::snprintf(line, countof(line), "Exception 0x%08X at 0x%p\n",
static_cast<unsigned>(exi->ExceptionRecord->ExceptionCode), exi->ExceptionRecord->ExceptionAddress);
WriteFile(hFile, line, static_cast<DWORD>(std::strlen(line)), &written, nullptr);
}
@ -207,9 +207,13 @@ bool Install()
return false;
}
void SetWriteDirectory(const std::string_view& dump_directory) {}
void SetWriteDirectory(const std::string_view& dump_directory)
{
}
void Uninstall() {}
void Uninstall()
{
}
} // namespace CrashHandler

View File

@ -424,7 +424,7 @@ public:
LPSTR m_szSymPath;
#pragma pack(push, 8)
typedef struct IMAGEHLP_MODULE64_V3
struct IMAGEHLP_MODULE64_V3
{
DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64)
DWORD64 BaseOfImage; // base load address of module
@ -453,7 +453,7 @@ public:
BOOL Publics; // contains public symbols
};
typedef struct IMAGEHLP_MODULE64_V2
struct IMAGEHLP_MODULE64_V2
{
DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64)
DWORD64 BaseOfImage; // base load address of module
@ -805,6 +805,8 @@ private:
case 8: //SymVirtual:
szSymType = "Virtual";
break;
default:
break;
}
}
LPCSTR pdbName = Module.LoadedImageName;

View File

@ -336,7 +336,7 @@ void Timer::NanoSleep(std::uint64_t ns)
if (SetWaitableTimer(timer, &due_time, 0, nullptr, nullptr, FALSE))
WaitForSingleObject(timer, INFINITE);
else
std::fprintf(stderr, "SetWaitableTimer() failed: %08X\n", GetLastError());
std::fprintf(stderr, "SetWaitableTimer() failed: %08X\n", static_cast<unsigned>(GetLastError()));
}
else
{

View File

@ -1495,11 +1495,12 @@ void FullscreenUI::DrawInputBindingWindow()
if (ImGui::BeginPopupModal(title, nullptr,
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoInputs))
{
ImGui::TextWrapped(
SmallString::FromFmt(FSUI_FSTR("Setting {} binding {}."), s_input_binding_section, s_input_binding_display_name));
ImGui::TextWrapped("%s", SmallString::FromFmt(FSUI_FSTR("Setting {} binding {}."), s_input_binding_section,
s_input_binding_display_name)
.GetCharArray());
ImGui::TextUnformatted(FSUI_CSTR("Push a controller button or axis now."));
ImGui::NewLine();
ImGui::Text(FSUI_CSTR("Timing out in %.0f seconds..."), time_remaining);
ImGui::TextUnformatted(SmallString::FromFmt(FSUI_FSTR("Timing out in {:.0f} seconds..."), time_remaining));
ImGui::EndPopup();
}
@ -6234,16 +6235,18 @@ void FullscreenUI::DrawCoverDownloaderWindow()
if (ImGui::BeginPopupModal("Download Covers", &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize))
{
ImGui::TextWrapped(
"%s",
FSUI_CSTR("DuckStation can automatically download covers for games which do not currently have a cover set. We "
"do not host any cover images, the user must provide their own source for images."));
ImGui::NewLine();
ImGui::TextWrapped(FSUI_CSTR("In the form below, specify the URLs to download covers from, with one template URL "
ImGui::TextWrapped("%s",
FSUI_CSTR("In the form below, specify the URLs to download covers from, with one template URL "
"per line. The following variables are available:"));
ImGui::NewLine();
ImGui::TextWrapped(FSUI_CSTR("${title}: Title of the game.\n${filetitle}: Name component of the game's "
"filename.\n${serial}: Serial of the game."));
ImGui::TextWrapped("%s", FSUI_CSTR("${title}: Title of the game.\n${filetitle}: Name component of the game's "
"filename.\n${serial}: Serial of the game."));
ImGui::NewLine();
ImGui::TextWrapped(FSUI_CSTR("Example: https://www.example-not-a-real-domain.com/covers/${serial}.jpg"));
ImGui::TextWrapped("%s", FSUI_CSTR("Example: https://www.example-not-a-real-domain.com/covers/${serial}.jpg"));
ImGui::NewLine();
BeginMenuButtons();

View File

@ -135,7 +135,7 @@ void ControllerLEDSettingsDialog::linkButton(ColorPickerButton* button, u32 play
SDLInputSource::ParseRGBForPlayerId(m_dialog->getStringValue("SDLExtra", key.c_str(), ""), player_id);
button->setColor(current_value);
connect(button, &ColorPickerButton::colorChanged, this, [this, player_id, key = std::move(key)](u32 new_rgb) {
connect(button, &ColorPickerButton::colorChanged, this, [this, key = std::move(key)](u32 new_rgb) {
m_dialog->setStringValue("SDLExtra", key.c_str(), fmt::format("{:06X}", new_rgb).c_str());
});
#endif

View File

@ -368,9 +368,16 @@
<AdditionalDependencies>$(QtEntryPointLib);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<PreprocessorDefinitions>QT_NO_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4127;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Configuration.Contains(Clang))">
<ClCompile>
<!-- Throws warning : known but unsupported action 'shared' for '#pragma section' - ignored [-Wignored-pragmas] -->
<AdditionalOptions Condition="$(Configuration.Contains(Clang))">-Wno-ignored-pragmas %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="..\..\dep\msvc\vsprops\Targets.props" />
<Import Project="..\..\dep\msvc\vsprops\QtCompile.targets" />
</Project>
</Project>

View File

@ -84,7 +84,7 @@ public:
void UnmapIndexBuffer(u32 used_index_count) override;
void PushUniformBuffer(const void* data, u32 data_size) override;
void* MapUniformBuffer(u32 size) override;
void UnmapUniformBuffer(u32 size);
void UnmapUniformBuffer(u32 size) override;
void SetFramebuffer(GPUFramebuffer* fb) override;
void SetPipeline(GPUPipeline* pipeline) override;
void SetTextureSampler(u32 slot, GPUTexture* texture, GPUSampler* sampler) override;