Reduced lib build complecsity

This commit is contained in:
ktlo
2019-10-11 11:06:21 +00:00
parent e1249f68e5
commit a45204ff0a
4 changed files with 3 additions and 11 deletions

View File

@@ -21,13 +21,7 @@ subdir('include')
subdir('src') subdir('src')
subdir('test') subdir('test')
if get_option('link_type') == 'static' dep = declare_dependency(link_with : lib, include_directories : includes)
chosen_lib = static_lib
else
chosen_lib = shared_lib
endif
dep = declare_dependency(link_with : chosen_lib, include_directories : includes)
cppcheck = custom_target(meson.project_name() + '_cppcheck_internal', cppcheck = custom_target(meson.project_name() + '_cppcheck_internal',
output : meson.project_name() + '_cppcheck.log', output : meson.project_name() + '_cppcheck.log',

View File

@@ -1 +0,0 @@
option('link_type', type : 'combo', choices : ['static', 'shared'], value : 'static')

View File

@@ -13,5 +13,4 @@ sources += configure_file(output : 'config.cpp', input : 'config.cpp.in',
'maintainer' : maintainer, 'maintainer' : maintainer,
}) })
static_lib = static_library(meson.project_name(), sources, include_directories : includes, install: true, dependencies: module_deps) lib = library(meson.project_name(), sources, include_directories : includes, install: true, dependencies: module_deps)
shared_lib = shared_library(meson.project_name(), sources, include_directories : includes, install: true, dependencies: module_deps)

View File

@@ -6,6 +6,6 @@ test_files = []
foreach test_name : test_names foreach test_name : test_names
test_files += files(test_name + '.cpp') test_files += files(test_name + '.cpp')
test_exe = executable(test_name + '.test', test_files[-1], link_with : static_lib, include_directories : [includes, src], dependencies : module_deps) test_exe = executable(test_name + '.test', test_files[-1], link_with : lib, include_directories : [includes, src], dependencies : module_deps)
test(test_name, test_exe, suite : 'regular') test(test_name, test_exe, suite : 'regular')
endforeach endforeach