Skip to content

How to use include_directories() and cc.find_library() in generated code? #13127

Answered by nils-werner
nils-werner asked this question in Q&A
Discussion options

You must be logged in to vote

I kind of I got it to work with a build.sh similar to

#!/usr/bin/env bash

gen_src "${tmp_dir}"
make -C "${tmp_dir}"
mv "${tmp_dir}/lib/"* "${out_dir}"
mv "${tmp_dir}/include/"* "${out_dir}"

and a meson.build like

sh_script = find_program('./tools/build.sh')

bsp_libs = [
    'libxil.a',
]

# there are many more headers generated, these are the ones that seemed necessary
bsp_headers = [
    'sleep.h',
    'xil_io.h',
    'xparameters_ps.h',
]

bsp_misc = [
    'wrapper.bit',
]

bsp = custom_target(
    'bsp',
    input : [ hdf_file, 'system.mss' ],
    output : [
        bsp_misc,
        bsp_headers,
        bsp_libs,
    ],
    command : [
        sh_script,
        '@INPUT@',
        …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@nils-werner
Comment options

Comment options

You must be logged in to vote
2 replies
@nils-werner
Comment options

@nils-werner
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nils-werner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants