From 22a0f4033af6d8dd6a59a53f855ef584d65fcdd9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 27 Dec 2022 12:30:19 +0200 Subject: [PATCH] aedi: add quasi-glib option --- aedi/builder.py | 2 ++ aedi/state.py | 2 ++ aedi/target/main.py | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/aedi/builder.py b/aedi/builder.py index e8def982..689684c7 100644 --- a/aedi/builder.py +++ b/aedi/builder.py @@ -91,6 +91,7 @@ class Builder(object): self._environment = state.environment state.static_moltenvk = arguments.static_moltenvk + state.quasi_glib = arguments.quasi_glib state.jobs = arguments.jobs and arguments.jobs or self._get_default_job_count() def _get_default_job_count(self): @@ -345,5 +346,6 @@ class Builder(object): group = parser.add_argument_group('Hacks') group.add_argument('--static-moltenvk', action='store_true', help='link with static MoltenVK library') + group.add_argument('--quasi-glib', action='store_true', help='link with QuasiGlib library') return parser.parse_args(args) diff --git a/aedi/state.py b/aedi/state.py index 5fcf63b3..73d487ba 100644 --- a/aedi/state.py +++ b/aedi/state.py @@ -55,7 +55,9 @@ class BuildState: self.xcode = False self.verbose = False self.jobs = 1 + self.static_moltenvk = False + self.quasi_glib = False self.environment = os.environ.copy() self.options = CommandLineOptions() diff --git a/aedi/target/main.py b/aedi/target/main.py index 09f34b4a..fe92238f 100644 --- a/aedi/target/main.py +++ b/aedi/target/main.py @@ -86,8 +86,16 @@ class ZDoomBaseTarget(CMakeMainTarget): super().__init__(name) def configure(self, state: BuildState): + pkg_config_args = ['--libs', 'openal', 'sndfile'] + linker_flags = '' + + if state.quasi_glib: + linker_flags = '-lquasi-glib ' + else: + pkg_config_args.append('glib-2.0') + opts = state.options - opts['CMAKE_EXE_LINKER_FLAGS'] += state.run_pkg_config('--libs', 'glib-2.0', 'libmpg123', 'openal', 'sndfile') + opts['CMAKE_EXE_LINKER_FLAGS'] += linker_flags + state.run_pkg_config(*pkg_config_args) opts['PK3_QUIET_ZIPDIR'] = 'YES' opts['DYN_OPENAL'] = 'NO'