diff --git a/aedi/target/library_tier1.py b/aedi/target/library_tier1.py index a9dd7cc4..6ceb809e 100644 --- a/aedi/target/library_tier1.py +++ b/aedi/target/library_tier1.py @@ -375,16 +375,22 @@ class OpenALTarget(CMakeStaticDependencyTarget): def detect(self, state: BuildState) -> bool: return os.path.exists(state.source + 'openal.pc.in') + FRAMEWORKS = '-framework ApplicationServices -framework AudioToolbox -framework AudioUnit -framework CoreAudio' + + def post_build(self, state: BuildState): + super().post_build(state) + + def update_cmake_libs(line: str): + link_libs = ' INTERFACE_LINK_LIBRARIES ' + return f'{link_libs}"{OpenALTarget.FRAMEWORKS}"\n' if line.startswith(link_libs) else line + + config_path = state.install_path + '/lib/cmake/OpenAL/OpenALConfig.cmake' + self.update_text_file(config_path, update_cmake_libs) + @staticmethod def _process_pkg_config(pcfile: str, line: str) -> str: libs_private = 'Libs.private:' - - if line.startswith(libs_private): - # Fix full paths to OS frameworks - return libs_private + ' -framework ApplicationServices -framework AudioToolbox'\ - ' -framework AudioUnit -framework CoreAudio' + os.linesep - else: - return line + return f'{libs_private} {OpenALTarget.FRAMEWORKS}\n' if line.startswith(libs_private) else line class OpusTarget(CMakeStaticDependencyTarget):