60 lines
1.4 KiB
Meson
60 lines
1.4 KiB
Meson
project('edac extension module',
|
|
'cpp',
|
|
meson_version: '>= 1.3',
|
|
default_options: [
|
|
'c_std=c99',
|
|
'cpp_std=c++14',
|
|
'fortran_std=legacy',
|
|
'python.install_env=auto',
|
|
'warning_level=2',
|
|
]
|
|
)
|
|
|
|
py_mod = import('python')
|
|
py3 = py_mod.find_installation('python3', pure: false)
|
|
py3_dep = py3.dependency()
|
|
|
|
cpp = meson.get_compiler('cpp')
|
|
|
|
# silence warnings in edac code
|
|
_global_cpp_args = cpp.get_supported_arguments(
|
|
'-Wno-maybe-uninitialized',
|
|
'-Wno-unused-result',
|
|
'-Wno-unused-variable',
|
|
'-Wno-unused-function',
|
|
'-Wno-write-strings',
|
|
'-Wno-dangling-else',
|
|
'-Wno-misleading-indentation',
|
|
'-Wno-format-extra-args',
|
|
'-Wno-int-in-bool-context',
|
|
)
|
|
add_project_arguments(_global_cpp_args, language : 'cpp')
|
|
|
|
# swig wrapper
|
|
|
|
swig = find_program('swig')
|
|
edac_module = custom_target(
|
|
input: ['src/edac.i'],
|
|
output: ['@BASENAME@_wrap.cpp', '@BASENAME@.py'],
|
|
command: [swig, '-c++', '-python', '-py3', '-o', '@OUTPUT0@', '@INPUT@'],
|
|
install: true,
|
|
install_dir: [false, py3.get_install_dir()],
|
|
)
|
|
|
|
# shared library
|
|
|
|
edac_lib = py3.extension_module('_edac',
|
|
['src/edac.cpp', edac_module],
|
|
include_directories: ['src'],
|
|
dependencies : py3_dep,
|
|
install: true,
|
|
)
|
|
|
|
edac_dep = declare_dependency(
|
|
sources : [edac_module[1]],
|
|
dependencies : py3_dep,
|
|
link_with : edac_lib,
|
|
)
|
|
|
|
test('edac', py3, args : ['-c', 'from edac import run_script; exit(0)'])
|