Python script to regenerate projects using premake (#37)

* Add script to regenerate projects using premake
This commit is contained in:
Dario Vladović 2020-06-14 06:09:10 +02:00 committed by GitHub
parent cbd65982cc
commit 2de2d26528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")