mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 13:21:05 +00:00
allow to use build script as module
This commit is contained in:
parent
bce57df3cd
commit
fdf996a297
1 changed files with 5 additions and 10 deletions
15
build.py
15
build.py
|
@ -29,7 +29,6 @@ import argparse
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
class Configuration(object):
|
class Configuration(object):
|
||||||
|
@ -77,7 +76,7 @@ def copy_moltenvk(config: Configuration):
|
||||||
copy_func(src_path, dst_path)
|
copy_func(src_path, dst_path)
|
||||||
|
|
||||||
|
|
||||||
def create_configuration():
|
def create_configuration(args: list):
|
||||||
target_list = (
|
target_list = (
|
||||||
Target('gzdoom', 'https://github.com/coelckers/gzdoom.git', copy_moltenvk),
|
Target('gzdoom', 'https://github.com/coelckers/gzdoom.git', copy_moltenvk),
|
||||||
Target('raze', 'https://github.com/coelckers/Raze.git'),
|
Target('raze', 'https://github.com/coelckers/Raze.git'),
|
||||||
|
@ -94,7 +93,7 @@ def create_configuration():
|
||||||
parser.add_argument('--source-path', help='path to target\'s source code')
|
parser.add_argument('--source-path', help='path to target\'s source code')
|
||||||
parser.add_argument('--build-path', help='target build path')
|
parser.add_argument('--build-path', help='target build path')
|
||||||
parser.add_argument('--sdk-path', help='path to macOS SDK')
|
parser.add_argument('--sdk-path', help='path to macOS SDK')
|
||||||
arguments = parser.parse_args()
|
arguments = parser.parse_args(args)
|
||||||
|
|
||||||
config = Configuration()
|
config = Configuration()
|
||||||
config.target = targets[arguments.target]
|
config.target = targets[arguments.target]
|
||||||
|
@ -231,8 +230,8 @@ def build_target(config: Configuration):
|
||||||
config.target.post_build(config)
|
config.target.post_build(config)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def build(args: list):
|
||||||
config = create_configuration()
|
config = create_configuration(args)
|
||||||
create_prefix_directory(config)
|
create_prefix_directory(config)
|
||||||
|
|
||||||
prepare_source(config)
|
prepare_source(config)
|
||||||
|
@ -241,8 +240,4 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if sys.hexversion < 0x3070000:
|
build(sys.argv[1:])
|
||||||
print('This script requires Python 3.7 or newer')
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
main()
|
|
||||||
|
|
Loading…
Reference in a new issue