Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: use library() and fix external builds #768

Merged
merged 2 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libvmaf/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project('libvmaf', ['c', 'cpp'],
'cpp_std=c++11',
'warning_level=2',
'buildtype=release',
'default_library=both',
],
meson_version: '>= 0.47.0')

Expand Down
8 changes: 6 additions & 2 deletions libvmaf/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ if built_in_models_enabled
json_model_c_sources += custom_target(
model_file,
output : '@[email protected]',
input : model_dir + model_file,
input : configure_file(
input : model_dir + model_file,
output : model_file,
copy: true
),
command : [xxd, '--include', '@INPUT@', '@OUTPUT@'],
)
endforeach
Expand Down Expand Up @@ -297,7 +301,7 @@ else
vmaf_soversion = vmaf_api_version_major
endif

libvmaf = both_libraries(
libvmaf = library(
'vmaf',
[libvmaf_sources, rev_target, json_model_c_sources],
include_directories : [libvmaf_inc, vmaf_include],
Expand Down
48 changes: 24 additions & 24 deletions libvmaf/src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,54 @@ typedef struct VmafBuiltInModel {

#if VMAF_BUILT_IN_MODELS
#if VMAF_FLOAT_FEATURES
extern const char ___src_______model_vmaf_float_v0_6_1neg_json;
extern const int ___src_______model_vmaf_float_v0_6_1neg_json_len;
extern const char ___src_______model_vmaf_float_v0_6_1_json;
extern const int ___src_______model_vmaf_float_v0_6_1_json_len;
extern const char ___src_______model_vmaf_float_b_v0_6_3_json;
extern const int ___src_______model_vmaf_float_b_v0_6_3_json_len;
extern const char src_vmaf_float_v0_6_1neg_json;
extern const int src_vmaf_float_v0_6_1neg_json_len;
extern const char src_vmaf_float_v0_6_1_json;
extern const int src_vmaf_float_v0_6_1_json_len;
extern const char src_vmaf_float_b_v0_6_3_json;
extern const int src_vmaf_float_b_v0_6_3_json_len;
#endif
extern const char ___src_______model_vmaf_v0_6_1_json;
extern const int ___src_______model_vmaf_v0_6_1_json_len;
extern const char ___src_______model_vmaf_b_v0_6_3_json;
extern const int ___src_______model_vmaf_b_v0_6_3_json_len;
extern const char ___src_______model_vmaf_v0_6_1neg_json;
extern const int ___src_______model_vmaf_v0_6_1neg_json_len;
extern const char src_vmaf_v0_6_1_json;
extern const int src_vmaf_v0_6_1_json_len;
extern const char src_vmaf_b_v0_6_3_json;
extern const int src_vmaf_b_v0_6_3_json_len;
extern const char src_vmaf_v0_6_1neg_json;
extern const int src_vmaf_v0_6_1neg_json_len;
#endif

static const VmafBuiltInModel built_in_models[] = {
#if VMAF_BUILT_IN_MODELS
#if VMAF_FLOAT_FEATURES
{
.version = "vmaf_float_v0.6.1neg",
.data = &___src_______model_vmaf_float_v0_6_1neg_json,
.data_len = &___src_______model_vmaf_float_v0_6_1neg_json_len,
.data = &src_vmaf_float_v0_6_1neg_json,
.data_len = &src_vmaf_float_v0_6_1neg_json_len,
},
{
.version = "vmaf_float_v0.6.1",
.data = &___src_______model_vmaf_float_v0_6_1_json,
.data_len = &___src_______model_vmaf_float_v0_6_1_json_len,
.data = &src_vmaf_float_v0_6_1_json,
.data_len = &src_vmaf_float_v0_6_1_json_len,
},
{
.version = "vmaf_float_b_v0.6.3",
.data = &___src_______model_vmaf_float_b_v0_6_3_json,
.data_len = &___src_______model_vmaf_float_b_v0_6_3_json_len,
.data = &src_vmaf_float_b_v0_6_3_json,
.data_len = &src_vmaf_float_b_v0_6_3_json_len,
},
#endif
{
.version = "vmaf_v0.6.1",
.data = &___src_______model_vmaf_v0_6_1_json,
.data_len = &___src_______model_vmaf_v0_6_1_json_len,
.data = &src_vmaf_v0_6_1_json,
.data_len = &src_vmaf_v0_6_1_json_len,
},
{
.version = "vmaf_b_v0.6.3",
.data = &___src_______model_vmaf_b_v0_6_3_json,
.data_len = &___src_______model_vmaf_b_v0_6_3_json_len,
.data = &src_vmaf_b_v0_6_3_json,
.data_len = &src_vmaf_b_v0_6_3_json_len,
},
{
.version = "vmaf_v0.6.1neg",
.data = &___src_______model_vmaf_v0_6_1neg_json,
.data_len = &___src_______model_vmaf_v0_6_1neg_json_len,
.data = &src_vmaf_v0_6_1neg_json,
.data_len = &src_vmaf_v0_6_1neg_json_len,
},
#endif
{ 0 }
Expand Down
2 changes: 1 addition & 1 deletion libvmaf/test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_inc = include_directories('.')
test_context = executable('test_context',
['test.c', 'test_context.c'],
include_directories : [libvmaf_inc, test_inc],
link_with : libvmaf.get_static_lib(),
link_with : get_option('default_library') == 'both' ? libvmaf.get_static_lib() : libvmaf,
dependencies:[stdatomic_dependency],
)

Expand Down
4 changes: 2 additions & 2 deletions libvmaf/tools/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vmafossexec = executable(
dependencies: [stdatomic_dependency],
c_args : vmaf_cflags_common,
cpp_args : vmaf_cflags_common,
link_with : libvmaf.get_static_lib(),
link_with : get_option('default_library') == 'both' ? libvmaf.get_static_lib() : libvmaf,
install : false,
)

Expand All @@ -20,6 +20,6 @@ vmaf = executable(
include_directories : [libvmaf_inc, vmaf_include],
dependencies: [stdatomic_dependency],
c_args : [vmaf_cflags_common, compat_cflags],
link_with : libvmaf.get_static_lib(),
link_with : get_option('default_library') == 'both' ? libvmaf.get_static_lib() : libvmaf,
install : true,
)