Commit 947b51c1 authored by Ghislain MARY's avatar Ghislain MARY

No longer depend on sed to generate shader code.

parent edb987b4
......@@ -22,12 +22,8 @@
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "${INPUT_DIR}/../tools/xxd.py" "-i" "${SOURCE_FILE}"
OUTPUT_FILE "${OUTPUT_DIR}/${SOURCE_FILE}.tmp"
WORKING_DIRECTORY ${INPUT_DIR}
)
execute_process(
COMMAND "${SED_PROGRAM}" "s/}\;/,0x00}\;/" "${OUTPUT_DIR}/${SOURCE_FILE}.tmp"
OUTPUT_FILE "${OUTPUT_DIR}/${SOURCE_FILE}.h.tmp"
WORKING_DIRECTORY ${INPUT_DIR}
)
if(EXISTS "${OUTPUT_DIR}/${SOURCE_FILE}.h")
file(READ "${OUTPUT_DIR}/${SOURCE_FILE}.h" OLD_CONTENT)
......@@ -39,6 +35,5 @@ else()
file(RENAME "${OUTPUT_DIR}/${SOURCE_FILE}.h.tmp" "${OUTPUT_DIR}/${SOURCE_FILE}.h")
endif()
file(REMOVE
"${OUTPUT_DIR}/${SOURCE_FILE}.tmp"
"${OUTPUT_DIR}/${SOURCE_FILE}.h.tmp"
)
......@@ -39,7 +39,7 @@ def include_hexdump(infilename):
break
print_include_hexdump_line(buf)
size = size + len(buf)
print("};")
print(",0x00};")
print("unsigned int {0}_len = {1};".format(varname, size))
def print_hexdump_line(counter, buf):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment