Dependency for native build in Meson

131 views Asked by At

I have a Meson project that includes a test suite to be run on the build machine even during cross compilation. The test executables are tagged native: true, but they pull in catch2 as a dependency through the wrapdb, and that isn't native, leading to errors during cross build.

project('demo', 'cpp', default_options: [ 'cpp_std=c++20' ])

catch2 = dependency('catch2-with-main',
    fallback: [ 'catch2', 'catch2_with_main_dep' ],
    default_options: [ 'tests=false' ],
    native: true)

uut_lib = static_library('uut', 'uut.cpp', native: true)
uut_inc = include_directories('.')
uut = declare_dependency(
    link_with: [ uut_lib ],
    include_directories: [ uut_inc ])

test('test1',
    executable('test1', 'test1.cpp',
        dependencies: [ uut, catch2 ],
        native: true))

Is there a way I can configure a subproject as native=true?

0

There are 0 answers