aedi: patch linker flags in openal cmake module

This commit is contained in:
alexey.lysiuk 2021-06-06 13:09:01 +03:00
parent 5cae91d01a
commit eaa0257b2e

View file

@ -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):