[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

@@ -1,26 +1,23 @@
cmake_minimum_required(VERSION 3.10)
project(renderer_EGL LANGUAGES C CXX)
find_program(AWK NAMES gawk mawk original-awk awk)
if(AWK MATCHES ".+-NOTFOUND")
message(FATAL_ERROR "FATAL: some known version of awk couldn't be found (${AWK}).")
else()
message(STATUS "Using awk: ${AWK}")
endif()
include(MakeObject)
function(build_shaders header_dir)
file(GLOB headers "${header_dir}/*.h")
set(EGL_SHADER_PROCESSED)
set(include_dir "${CMAKE_CURRENT_SOURCE_DIR}/${header_dir}")
foreach(shader ${ARGN})
set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${shader}")
add_custom_command(OUTPUT "${out_f}"
COMMAND "${AWK}" -f "${CMAKE_CURRENT_SOURCE_DIR}/glsl.include.awk"
"${CMAKE_CURRENT_SOURCE_DIR}/${shader}" > "${out_f}"
add_custom_command(
OUTPUT "${out_f}"
COMMAND "${CMAKE_COMMAND}"
"-DLG_MAKE_OBJECT_ACTION=PREPROCESS"
"-DLG_MAKE_OBJECT_INPUT=${CMAKE_CURRENT_SOURCE_DIR}/${shader}"
"-DLG_MAKE_OBJECT_OUTPUT=${out_f}"
"-DLG_MAKE_OBJECT_INCLUDE_DIR=${include_dir}"
-P "${LG_MAKE_OBJECT_SCRIPT}"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${shader}"
DEPENDS ${headers}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/shader"
DEPENDS ${headers} "${LG_MAKE_OBJECT_SCRIPT}"
COMMENT "Preprocessing shader ${shader}"
VERBATIM
)

View File

@@ -18,7 +18,6 @@
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include "filter.h"
#include "effect.h"
#include "app.h"
@@ -45,7 +44,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#define GLSL_MAX_TEXTURES 16
#define GLSL_EXPR_STACK 128
@@ -633,11 +631,11 @@ static bool evaluateExpression(const GLSLContext * context,
if (!copy)
return false;
double stack[GLSL_EXPR_STACK];
double stack[GLSL_EXPR_STACK];
unsigned int count = 0;
char * state;
for (char * token = strtok_r(copy, " \t\r\n", &state); token;
token = strtok_r(NULL, " \t\r\n", &state))
char * state = NULL;
for (char * token = lg_strtok_r(copy, " \t\r\n", &state); token;
token = lg_strtok_r(NULL, " \t\r\n", &state))
{
if (!strcmp(token, "!"))
{
@@ -1077,7 +1075,7 @@ static bool createFilter(const char * root, const char * relative,
if (!this->relative || !this->base.ops.name)
goto fail;
char * extension = strrchr((char *)this->base.ops.name, '.');
if (extension && !strcasecmp(extension, ".glsl"))
if (extension && !lg_strcasecmp(extension, ".glsl"))
*extension = '\0';
app_registerImGuiText(this->base.ops.name);
@@ -1118,7 +1116,7 @@ static void glslFree(EGL_Filter * filter)
static bool hasGLSLExtension(const char * name)
{
const char * extension = strrchr(name, '.');
return extension && !strcasecmp(extension, ".glsl");
return extension && !lg_strcasecmp(extension, ".glsl");
}
static bool scanDirectory(const char * root, const char * relative,

View File

@@ -1,13 +0,0 @@
BEGIN { FS="\"" }
function process(line, second) {
if (line ~ /^#include[ \t]*".+"[ \t\r]*$/) {
while (getline < second) {
process($0, $2)
}
} else {
print line
}
}
{ process($0, $2) } END { print "\0"; }

View File

@@ -154,7 +154,7 @@ static void loadPresetList(struct EGL_PostProcess * this)
continue;
DEBUG_INFO("Found preset: %s", entry);
char * name = strdup(entry);
char * name = lg_strdup(entry);
if (!name)
{
DEBUG_ERROR("Failed to allocate memory");
@@ -260,7 +260,7 @@ static void reorderFilters(struct EGL_PostProcess * this)
return;
}
char * orderStr = strdup(option_get_string("eglFilter", "order"));
char * orderStr = lg_strdup(option_get_string("eglFilter", "order"));
if (!orderStr)
{
DEBUG_ERROR("Failed to allocate memory");
@@ -339,7 +339,8 @@ static void savePresetAs(struct EGL_PostProcess * this)
}
}
this->activePreset = stringlist_push(this->presets, strdup(this->presetEdit));
this->activePreset = stringlist_push(
this->presets, lg_strdup(this->presetEdit));
}
static void deletePreset(struct EGL_PostProcess * this)
@@ -396,7 +397,7 @@ static bool presetsUI(struct EGL_PostProcess * this)
if (this->activePreset >= 0)
savePreset(this, stringlist_at(this->presets, this->activePreset));
else
presetError(this, strdup("You must select a preset to save."));
presetError(this, lg_strdup("You must select a preset to save."));
}
if (igIsItemHovered(ImGuiHoveredFlags_None) && this->activePreset >= 0)