Unmodified ioquake3 source from https://github.com/ioquake/ioq3 (commit 83a7762, Sep 2026), the base for the cyberdeck arena game code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
497 B
CMake
13 lines
497 B
CMake
# 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}")
|