mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-25 13:21:05 +00:00
build script: extract base target class
This commit is contained in:
parent
d8fc93a041
commit
5083a3c683
1 changed files with 24 additions and 12 deletions
36
build.py
36
build.py
|
@ -46,23 +46,41 @@ class CommandLineOptions(dict):
|
|||
return result
|
||||
|
||||
|
||||
class Target:
|
||||
class BaseTarget:
|
||||
def __init__(self, name=None):
|
||||
self.name = name
|
||||
self.src_root = ''
|
||||
self.prefix = None
|
||||
self.environment = os.environ
|
||||
self.options = CommandLineOptions()
|
||||
|
||||
def prepare_source(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
def initialize(self, builder: 'Builder'):
|
||||
self.prefix = builder.deps_path + self.name
|
||||
pass
|
||||
|
||||
def detect(self, builder: 'Builder') -> bool:
|
||||
return False
|
||||
|
||||
def configure(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
def build(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
def post_build(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
|
||||
class Target(BaseTarget):
|
||||
def __init__(self, name=None):
|
||||
super().__init__(name)
|
||||
|
||||
self.src_root = ''
|
||||
self.prefix = None
|
||||
self.environment = os.environ
|
||||
self.options = CommandLineOptions()
|
||||
|
||||
def initialize(self, builder: 'Builder'):
|
||||
self.prefix = builder.deps_path + self.name
|
||||
|
||||
def configure(self, builder: 'Builder'):
|
||||
os.makedirs(builder.build_path, exist_ok=True)
|
||||
|
||||
|
@ -71,12 +89,6 @@ class Target:
|
|||
+ os.pathsep + builder.bin_path
|
||||
self.environment['PKG_CONFIG_PATH'] = builder.lib_path + 'pkgconfig'
|
||||
|
||||
def build(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
def post_build(self, builder: 'Builder'):
|
||||
pass
|
||||
|
||||
def install(self, builder: 'Builder', options: 'CommandLineOptions' = None):
|
||||
if builder.xcode:
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue