Merge Go frontend (apiserver + xcecli) into meson build

This commit is contained in:
Rongsong Shen 2026-04-14 11:20:17 +08:00
parent 43dc12a36c
commit c9dc8c4676
205 changed files with 30793 additions and 328 deletions

View file

@ -5,7 +5,8 @@ project('xce',
default_options: [
'c_std=gnu17'])
with_debug=false
component = get_option('component')
with_debug = false
if get_option('buildtype') == 'debug'
# add -DWITH_DEBUG=1
@ -23,56 +24,63 @@ if get_option('buildtype') == 'debug'
'-fvar-tracking-assignments',
], language: ['c', 'cpp'])
add_project_link_arguments('-fno-lto', language: ['c', 'cpp'])
with_debug=true
with_debug = true
endif
add_project_arguments('-DVERSION_COMMIT_ID='+get_option('commit_id'), language: 'c')
c_compiler_id = meson.get_compiler('c').get_id()
if c_compiler_id == 'gcc' or c_compiler_id == 'clang'
wrap_link_args = ['-Wl,--wrap=printf', '-Wl,--wrap=perror']
else
wrap_link_args = []
endif
# Programs needed by all components
go_compiler = find_program('go')
pkgconfig = find_program('pkg-config')
go_build = files('tools/go_build')
go_build_program = find_program('go_build', go_build)
env_program = find_program('env')
include_dir = include_directories('include', 'include/xce')
if component != 'xcecli'
c_compiler_id = meson.get_compiler('c').get_id()
if c_compiler_id == 'gcc' or c_compiler_id == 'clang'
wrap_link_args = ['-Wl,--wrap=printf', '-Wl,--wrap=perror']
else
wrap_link_args = []
endif
cc = meson.get_compiler('c')
math_dep = cc.find_library('m', required: false)
rt_dep = cc.find_library('rt', required: false)
pkgconfig = find_program('pkg-config')
include_dir = include_directories('include', 'include/xce')
struct2json_dep = dependency('struct2json')
libcyaml_dep = dependency('libcyaml')
libyaml_dep = dependency('yaml-0.1')
libtirpc_dep = dependency('libtirpc')
librtti_dep = dependency('librtti')
cc = meson.get_compiler('c')
math_dep = cc.find_library('m', required: false)
rt_dep = cc.find_library('rt', required: false)
yaml_deps = [
libcyaml_dep,
libyaml_dep
]
struct2json_dep = dependency('struct2json')
libcyaml_dep = dependency('libcyaml')
libyaml_dep = dependency('yaml-0.1')
libtirpc_dep = dependency('libtirpc')
librtti_dep = dependency('librtti')
subdir('lib')
subdir('controller')
subdir('worker')
subdir('autoscaler')
subdir('scheduler')
subdir('apiserver')
yaml_deps = [
libcyaml_dep,
libyaml_dep
]
configure_file(
input: 'tools/appimage/entry.sh',
output: 'xce',
copy: true,
install: true,
install_dir: 'bin',
install_mode: 'rwxr-xr-x'
)
subdir('lib')
subdir('controller')
subdir('worker')
subdir('autoscaler')
subdir('scheduler')
subdir('frontend/apiserver')
install_data('docs/xce.md',
install_dir: 'share/docs')
configure_file(
input: 'tools/appimage/entry.sh',
output: 'xce',
copy: true,
install: true,
install_dir: 'bin',
install_mode: 'rwxr-xr-x'
)
install_data('docs/xce.md',
install_dir: 'share/docs')
endif
if component != 'xcecore'
subdir('frontend/xcecli')
endif