Make project Cmake ready
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
# bin2carray <output file> <input file>
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
@@ -18,7 +19,7 @@ with open(source_file, "rb") as src:
|
||||
data = src.read()
|
||||
|
||||
with open(dest_file, "w") as dest:
|
||||
header_guard = "__" + dest_file.replace('.', '_').replace('-', '_') + "_H__"
|
||||
header_guard = "__" + os.path.basename(dest_file).replace('.', '_').replace('-', '_') + "_H__"
|
||||
dest.write("#ifndef %s\n" % (header_guard))
|
||||
dest.write("#define %s\n" % (header_guard))
|
||||
dest.write("static const char binary_blob[%d] = {\n" % (len(data)))
|
||||
|
||||
Reference in New Issue
Block a user