[client] windows: add native clang-cl build

Build the Windows client against the MSVC ABI while retaining clang
language support. Use vcpkg for ANGLE and libsamplerate, and build
MsQuic with its bundled static OpenSSL.
This commit is contained in:
Geoffrey McRae
2026-10-02 18:52:45 +10:00
parent c456596bd7
commit 57f18d7e80
33 changed files with 583 additions and 205 deletions

View File

@@ -738,14 +738,14 @@ static bool optRendererParse(struct Option * opt, const char * str)
if (!str)
return false;
if (strcasecmp(str, "auto") == 0)
if (lg_strcasecmp(str, "auto") == 0)
{
g_params.forceRenderer = false;
return true;
}
for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i)
if (strcasecmp(str, LG_Renderers[i]->getName()) == 0)
if (lg_strcasecmp(str, LG_Renderers[i]->getName()) == 0)
{
g_params.forceRenderer = true;
g_params.forceRendererIndex = i;
@@ -771,12 +771,12 @@ static StringList optRendererValues(struct Option * opt)
static char * optRendererToString(struct Option * opt)
{
if (!g_params.forceRenderer)
return strdup("auto");
return lg_strdup("auto");
if (g_params.forceRendererIndex >= LG_RENDERER_COUNT)
return NULL;
return strdup(LG_Renderers[g_params.forceRendererIndex]->getName());
return lg_strdup(LG_Renderers[g_params.forceRendererIndex]->getName());
}
static bool parsePair(const char * str, long long * first, long long * second)
@@ -838,7 +838,7 @@ static StringList optPosValues(struct Option * opt)
static char * optPosToString(struct Option * opt)
{
if (g_params.center)
return strdup("center");
return lg_strdup("center");
int len = snprintf(NULL, 0, "%dx%d", g_params.x, g_params.y);
char * str = malloc(len + 1);
@@ -919,7 +919,7 @@ static bool optScancodeParse(struct Option * opt, const char * str)
if (!lg_keycode_to_name[i])
continue;
if (strcasecmp(lg_keycode_to_name[i], str) == 0)
if (lg_strcasecmp(lg_keycode_to_name[i], str) == 0)
{
opt->value.x_int = i;
return true;
@@ -981,11 +981,11 @@ static bool optMicDefaultParse(struct Option * opt, const char * str)
if (!str)
return false;
if (strcasecmp(str, "prompt") == 0)
if (lg_strcasecmp(str, "prompt") == 0)
g_params.micDefaultState = MIC_DEFAULT_PROMPT;
else if (strcasecmp(str, "allow") == 0)
else if (lg_strcasecmp(str, "allow") == 0)
g_params.micDefaultState = MIC_DEFAULT_ALLOW;
else if (strcasecmp(str, "deny") == 0)
else if (lg_strcasecmp(str, "deny") == 0)
g_params.micDefaultState = MIC_DEFAULT_DENY;
else
return false;
@@ -1010,11 +1010,11 @@ static char * optMicDefaultToString(struct Option * opt)
switch (g_params.micDefaultState)
{
case MIC_DEFAULT_PROMPT:
return strdup("prompt");
return lg_strdup("prompt");
case MIC_DEFAULT_ALLOW:
return strdup("allow");
return lg_strdup("allow");
case MIC_DEFAULT_DENY:
return strdup("deny");
return lg_strdup("deny");
}
return NULL;
@@ -1026,11 +1026,11 @@ static bool optAudioResamplerParse(
if (!str)
return false;
if (strcasecmp(str, "auto") == 0)
if (lg_strcasecmp(str, "auto") == 0)
g_params.audioResampler = AUDIO_RESAMPLER_AUTO;
else if (strcasecmp(str, "libsamplerate") == 0)
else if (lg_strcasecmp(str, "libsamplerate") == 0)
g_params.audioResampler = AUDIO_RESAMPLER_LIBSAMPLERATE;
else if (strcasecmp(str, "backend") == 0)
else if (lg_strcasecmp(str, "backend") == 0)
g_params.audioResampler = AUDIO_RESAMPLER_BACKEND;
else
return false;
@@ -1055,11 +1055,11 @@ static char * optAudioResamplerToString(struct Option * opt)
switch (g_params.audioResampler)
{
case AUDIO_RESAMPLER_AUTO:
return strdup("auto");
return lg_strdup("auto");
case AUDIO_RESAMPLER_LIBSAMPLERATE:
return strdup("libsamplerate");
return lg_strdup("libsamplerate");
case AUDIO_RESAMPLER_BACKEND:
return strdup("backend");
return lg_strdup("backend");
}
return NULL;

View File

@@ -28,6 +28,7 @@
#include "common/debug.h"
#include "common/event.h"
#include "common/locking.h"
#include "common/stringutils.h"
#include "common/thread.h"
#include "common/util.h"
@@ -561,7 +562,7 @@ bool lgTransportFallback_start(const char * transportName,
atomic_init(&fallback->usable, false);
atomic_init(&fallback->videoAcceptingEvents, false);
fallback->transportName = strdup(transportName);
fallback->transportName = lg_strdup(transportName);
if (!fallback->transportName)
goto fail;

View File

@@ -24,6 +24,7 @@
#include "common/debug.h"
#include "common/filesystem.h"
#include "common/locking.h"
#include "common/stringutils.h"
#include "cimgui.h"
@@ -33,7 +34,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
@@ -43,7 +44,7 @@
#define STBTT_STATIC
#define STB_TRUETYPE_IMPLEMENTATION
#include "repos/gui/cimgui/imgui/imstb_truetype.h"
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
@@ -360,7 +361,7 @@ static FontPlatformFaceResult uiFontAddFace(void * opaque,
return FONT_PLATFORM_FACE_ERROR;
}
char * fileCopy = strdup(file);
char * fileCopy = lg_strdup(file);
if (!fileCopy ||
!uiFontGlyphReserve(
&UIFontResolved, UIFontResolved.count + glyphCount))

View File

@@ -38,7 +38,7 @@ static OverlayImage l_image[LG_USER_STATUS_MAX] = { 0 };
static bool l_recordToggle;
static double l_scale = 1.0;
static void status_loadImage(const char * data, unsigned int size,
static void status_loadImage(const char * data, size_t size,
OverlayImage * image, int width, int height)
{
overlayFreeImage(image);

View File

@@ -95,7 +95,7 @@ void overlayTextMaybeURL(const char * text, bool wrapped)
igTextUnformatted(text, NULL);
}
bool overlayLoadSVG(const char * data, unsigned int size, OverlayImage * image,
bool overlayLoadSVG(const char * data, size_t size, OverlayImage * image,
int width, int height)
{
image->tex = NULL;