myxce/src/meson.build
Rongsong Shen cf55d691de
feat(xce-harness-component): relocate xce_test into standalone harness component
Move xce_test's 15 production sources + headers from src/controller/testsuite/
into a new src/harness/ component with its own meson.build, and strip every
now-dangling controller-side reference (11 controller_unit_test_src entries,
4 standalone test-binary blocks, 11 controller_test.c extern/RUN_TEST lines)
so the controller build is never left broken.

Fixes a broken relative-symlink bridge (xce_test_controller_link) added to
keep two controller-embedded tests (test_test_cli.c, test_xcetest_process_entry.c)
finding the relocated xce_test binary until task 2.1 moves them too.

Discovered and documented in design.md: four controller-domain regression
tests call functions directly from four of xce_test's own files, requiring
controller_unit_test to permanently recompile them from src/harness/ — a
real dependency neither the original discovery nor design audit caught.

controller_unit_test: 1228 Tests 0 Failures 0 Ignored (verified via the
Unity binary's own printed summary line, not just meson's aggregate count).

Task 1.1 of xce-harness-component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-14 05:08:15 +00:00

90 lines
2.5 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'),
'-DVERSION_BUILD_TIME='+get_option('build_time'),
'-DVERSION_DIRTY_FINGERPRINT='+get_option('dirty_fingerprint')], 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('harness')
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