forked from lei.chen/myxce
Reopens the 2026-07-21 design decision to keep xceadmin outside meson.
Standard onboarding consistency (README 3.3 `nix build .#xcecore` and
3.4 `meson compile` working for xceadmin like every other component)
outweighs the earlier concern about meson's single-artifact model not
fitting a multi-file pip install.
- src/xceadmin/meson.build: custom_target() wrapping install+test,
stamp-file output, build_always_stale (matches this repo's existing
clean-rebuild-every-invocation convention).
- src/xceadmin/meson-build.sh: out-of-tree pinned install + pytest;
stages a repo-mirror/ symlink tree so tests' fixed-relative-path
assumptions (src/configs/, src/schema/, ha/data/) still resolve from
a copied location, without touching their deliberate fail-loud
behavior.
- src/meson.build: subdir('xceadmin') under component != 'xcecli'.
- src/tools/xce-build.sh: xceadmin case now delegates to
`meson compile -C "$BUILD_DIR" xceadmin` instead of its own
pip/venv implementation, like every other component.
Verified both build paths: meson compile (165/165 passed) and
nix build --option sandbox false .#xcecore_debug (128 passed / 37
skipped — cert-dependent tests correctly skip under nix's
git-tracked-only hermetic source). AppImage bundling (README 3.5)
is explicitly deferred to future work, not part of this change.
87 lines
2.3 KiB
Meson
87 lines
2.3 KiB
Meson
project('xce',
|
|
['c'],
|
|
version: '0.0.1',
|
|
meson_version: '>=1.5',
|
|
default_options: [
|
|
'c_std=gnu17'])
|
|
|
|
component = get_option('component')
|
|
with_debug = false
|
|
|
|
if get_option('buildtype') == 'debug'
|
|
# add -DWITH_DEBUG=1
|
|
add_project_arguments(['-DWITH_DEBUG=1',
|
|
'-DDEBUG',
|
|
'-O0',
|
|
'-fno-lto',
|
|
'-Wno-cpp',
|
|
'-fno-inline',
|
|
'-fno-omit-frame-pointer',
|
|
'-ggdb',
|
|
'-gdwarf-4',
|
|
'-g3',
|
|
'-fvar-tracking',
|
|
'-fvar-tracking-assignments',
|
|
], language: ['c', 'cpp'])
|
|
add_project_link_arguments('-fno-lto', language: ['c', 'cpp'])
|
|
with_debug = true
|
|
endif
|
|
|
|
add_project_arguments('-DVERSION_COMMIT_ID='+get_option('commit_id'), language: 'c')
|
|
|
|
# Programs needed by all components
|
|
go_compiler = find_program('go')
|
|
go_build = files('tools/go_build')
|
|
go_build_program = find_program('go_build', go_build)
|
|
env_program = find_program('env')
|
|
|
|
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
|
|
|
|
pkgconfig = find_program('pkg-config')
|
|
include_dir = include_directories('include', 'include/xce')
|
|
|
|
cc = meson.get_compiler('c')
|
|
math_dep = cc.find_library('m', required: false)
|
|
rt_dep = cc.find_library('rt', required: false)
|
|
|
|
struct2json_dep = dependency('struct2json')
|
|
libcyaml_dep = dependency('libcyaml')
|
|
libyaml_dep = dependency('yaml-0.1')
|
|
libtirpc_dep = dependency('libtirpc')
|
|
librtti_dep = dependency('librtti')
|
|
|
|
yaml_deps = [
|
|
libcyaml_dep,
|
|
libyaml_dep
|
|
]
|
|
|
|
subdir('lib')
|
|
subdir('controller')
|
|
subdir('worker')
|
|
subdir('autoscaler')
|
|
subdir('scheduler')
|
|
subdir('frontend/apiserver')
|
|
subdir('xceadmin')
|
|
|
|
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
|