Add script to regenerate projects using premake (#755)

This commit is contained in:
Dario Vladović
2020-06-14 06:24:55 +02:00
committed by GitHub
parent b5894c6ff5
commit 909d1c9471

28
util/generate_projects.py Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
import sys
from os import getenv, path
from subprocess import PIPE, run
PREMAKE_DIR = path.join(path.dirname(__file__), "../projects/premake")
def has(prog):
return run(["command", "-v", prog], stdout=PIPE, stderr=PIPE).returncode == 0
def run_premake(action, os):
run([premake, action, os], cwd=PREMAKE_DIR)
premake = getenv("PREMAKE", "premake5")
if not has(premake):
print("error: {} is not found", premake, file=sys.stderr)
exit(1)
run_premake("gmake2", "bsd")
run_premake("gmake2", "linux")
run_premake("gmake2", "macosx")
run_premake("vs2017", "windows")
run_premake("vs2019", "windows")
run_premake("xcode4", "macosx")