Skip to content

Instantly share code, notes, and snippets.

@jenatali
Last active September 9, 2021 01:14
Show Gist options
  • Save jenatali/aecd7a5194a6eb3f1d4f9ced2b36c9cc to your computer and use it in GitHub Desktop.
Save jenatali/aecd7a5194a6eb3f1d4f9ced2b36c9cc to your computer and use it in GitHub Desktop.
Meson VS build repro
extern int static_lib_function(void);
int both_lib_function(void)
{
return static_lib_function();
}
from shutil import copyfile
import sys
copyfile(sys.argv[0], sys.argv[1])
int generated_function(void)
{
return 42;
}
project('test', 'c')
generated_c = custom_target(
'generated.c',
input : files('generated_source.c', 'copyfile.py'),
output : 'generated.c',
command : ['python', '@INPUT1@', '@INPUT0@', '@OUTPUT@'],
)
static_lib = static_library(
'static_lib',
[files('static_lib_source.c'), generated_c],
)
both_lib = both_libraries(
'both_lib',
[files('both_lib_source.c')],
link_with : [static_lib],
install : true,
)
extern int generated_function(void);
int static_lib_function(void)
{
return generated_function();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment