aedi: move glew to tier 3

This commit is contained in:
alexey.lysiuk 2022-06-19 09:54:48 +03:00
parent 06ef5ec39b
commit b05e6818ca
3 changed files with 41 additions and 41 deletions

View file

@ -73,7 +73,6 @@ def targets():
DumbTarget(),
FmtTarget(),
FreeTypeTarget(),
GlewTarget(),
HarfBuzzTarget(),
LuaTarget(),
LzmaTarget(),
@ -102,6 +101,7 @@ def targets():
ExpatTarget(),
FreeImageTarget(),
FtglTarget(),
GlewTarget(),
WxWidgetsTarget(),
# Tools

View file

@ -116,46 +116,6 @@ class FreeTypeTarget(CMakeStaticDependencyTarget):
self.update_text_file(cmake_module, update_linker_flags)
class GlewTarget(CMakeStaticDependencyTarget):
def __init__(self, name='glew'):
super().__init__(name)
self.src_root = 'build/cmake'
def prepare_source(self, state: BuildState):
state.download_source(
'https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz',
'd4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1')
def configure(self, state: BuildState):
state.options['BUILD_UTILS'] = 'NO'
super().configure(state)
LINKER_FLAGS = '-framework OpenGL'
def post_build(self, state: BuildState):
super().post_build(state)
def update_linker_flags(line: str):
link_var = ' INTERFACE_LINK_LIBRARIES '
if line.startswith(link_var):
return f'{link_var}"{GlewTarget.LINKER_FLAGS}"\n'
return line
cmake_module = state.install_path / 'lib/cmake/glew/glew-targets.cmake'
self.update_text_file(cmake_module, update_linker_flags)
@staticmethod
def _process_pkg_config(pcfile: Path, line: str) -> str:
libs = 'Libs:'
if line.startswith(libs):
return libs + ' -L${libdir} -lGLEW ' + GlewTarget.LINKER_FLAGS + os.linesep
return line
class HarfBuzzTarget(CMakeStaticDependencyTarget):
def __init__(self, name='harfbuzz'):
super().__init__(name)

View file

@ -98,6 +98,46 @@ class FtglTarget(ConfigureMakeStaticDependencyTarget):
super().configure(state)
class GlewTarget(CMakeStaticDependencyTarget):
def __init__(self, name='glew'):
super().__init__(name)
self.src_root = 'build/cmake'
def prepare_source(self, state: BuildState):
state.download_source(
'https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz',
'd4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1')
def configure(self, state: BuildState):
state.options['BUILD_UTILS'] = 'NO'
super().configure(state)
LINKER_FLAGS = '-framework OpenGL'
def post_build(self, state: BuildState):
super().post_build(state)
def update_linker_flags(line: str):
link_var = ' INTERFACE_LINK_LIBRARIES '
if line.startswith(link_var):
return f'{link_var}"{GlewTarget.LINKER_FLAGS}"\n'
return line
cmake_module = state.install_path / 'lib/cmake/glew/glew-targets.cmake'
self.update_text_file(cmake_module, update_linker_flags)
@staticmethod
def _process_pkg_config(pcfile: Path, line: str) -> str:
libs = 'Libs:'
if line.startswith(libs):
return libs + ' -L${libdir} -lGLEW ' + GlewTarget.LINKER_FLAGS + os.linesep
return line
class WxWidgetsTarget(CMakeStaticDependencyTarget):
def __init__(self, name='wxwidgets'):
super().__init__(name)