run generator scripts

This commit is contained in:
Jakob Meier
2022-03-14 18:43:16 +01:00
parent 9fc1e57943
commit f8f7848200
12 changed files with 1590 additions and 1437 deletions

View File

@ -12,6 +12,7 @@ import os
import sys
import argparse
import shutil
import stat
def main():
@ -102,7 +103,7 @@ def main():
build_path = source_location + os.path.sep + build_folder
remove_old_dir = False
if remove_old_dir:
shutil.rmtree(build_path)
rm_build_dir(build_path)
os.chdir(source_location)
os.mkdir(build_folder)
print(f"Navigating into build directory: {build_path}")
@ -117,6 +118,14 @@ def main():
print(f"\" {cmake_command} \"")
os.system(cmake_command)
print("-- CMake configuration done. --")
def rm_build_dir(path: str):
# On windows the permissions of the build directory may have been set to read-only. If this
# is the case the permissions are changed before trying to delete the directory.
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
shutil.rmtree(path)
def determine_source_location() -> str: