Skip to content

Commit

Permalink
Fixing the unity tool so that it builds properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakinwecker committed Nov 29, 2019
1 parent e3138ca commit b62eaf0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/givrunity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import glob
import os.path
import sys

class source:
def __init__(self, filename):
Expand Down Expand Up @@ -31,10 +32,10 @@ def write_to_file(self, fd):
fd.write(f"// END {self.name}\n")
fd.write(f"//------------------------------------------------------------------------------\n\n")

def unity_build():
def unity_build(src_dir):
headers = [
source(filename)
for filename in glob.iglob('givr/src/**/*.h', recursive=True)
for filename in glob.iglob(f'{src_dir}/**/*.h', recursive=True)
]
exclude = ["givr.h"]#, "tiny_obj_loader.h", "stb_image.h"]
headers = [h for h in headers if h.name not in exclude]
Expand Down Expand Up @@ -76,4 +77,6 @@ def unity_build():


if __name__ == "__main__":
unity_build()
if len(sys.argv) != 2:
sys.exit("Usage: ./tools/givrunity.py ./src")
unity_build(sys.argv[1])

0 comments on commit b62eaf0

Please sign in to comment.