aedi: use cmake in quasi-glib target

This commit is contained in:
alexey.lysiuk 2022-12-31 10:46:59 +02:00
parent cc919d0aff
commit e377a3aa9a
3 changed files with 8 additions and 12 deletions

View file

@ -507,21 +507,12 @@ class PcreTarget(ConfigureMakeStaticDependencyTarget):
self.update_config_script(state.install_path / 'bin/pcre-config')
class QuasiGlibTarget(BuildTarget):
class QuasiGlibTarget(CMakeStaticDependencyTarget):
def __init__(self, name='quasi-glib'):
super().__init__(name)
def build(self, state: BuildState):
lib_path = state.install_path / 'lib'
os.makedirs(lib_path, exist_ok=True)
commands = (
(state.cxx_compiler(), '-std=c++11', '-O3', '-c', state.patch_path / f'{self.name}.cpp'),
(state.host() + '-ar', '-crs', lib_path / f'lib{self.name}.a', f'{self.name}.o'),
)
for command in commands:
subprocess.run(command, check=True, cwd=state.build_path, env=state.environment)
def prepare_source(self, state: BuildState):
state.source = state.patch_path / self.name
class SndFileTarget(CMakeStaticDependencyTarget):

View file

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.1)
project(quasi-glib)
add_library(quasi-glib quasi-glib.cpp)
set_property(TARGET quasi-glib PROPERTY CXX_STANDARD 11)
install(TARGETS quasi-glib)