CMake build system

This commit is contained in:
Tim Angus committed 2025-08-03 17:36:01 +01:00
1 parent 4fed624cff
commit 4c6f3f81eb
40 files changed
+1641

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# Convert a shader file to a compilable C file
# INPUT_FILE, OUTPUT_FILE, SHADER_NAME must be set via -D
file(READ ${INPUT_FILE} CONTENTS)
string(REPLACE "\\" "\\\\" CONTENTS "${CONTENTS}") # Escape backslashes
string(REPLACE "\"" "\\\"" CONTENTS "${CONTENTS}") # Escape double quotes
string(REPLACE "\n" "\\n\"\n\"" CONTENTS "${CONTENTS}") # Escape newlines
set(OUTPUT_CONTENT "const char *fallbackShader_${SHADER_NAME} =\n\"${CONTENTS}\";\n")
file(WRITE ${OUTPUT_FILE} "${OUTPUT_CONTENT}")