From e705c2caae68368eaae23cacfca370619533487e Mon Sep 17 00:00:00 2001 From: sulincix Date: Thu, 15 Aug 2024 20:20:41 +0000 Subject: [PATCH] meson find C sources improvements and examples directory --- {src => example}/plugin/template.c | 0 {src => example}/plugin/template.vala | 0 meson.build | 26 +++++++------------------- 3 files changed, 7 insertions(+), 19 deletions(-) rename {src => example}/plugin/template.c (100%) rename {src => example}/plugin/template.vala (100%) diff --git a/src/plugin/template.c b/example/plugin/template.c similarity index 100% rename from src/plugin/template.c rename to example/plugin/template.c diff --git a/src/plugin/template.vala b/example/plugin/template.vala similarity index 100% rename from src/plugin/template.vala rename to example/plugin/template.vala diff --git a/meson.build b/meson.build index eb378048..d16048f6 100755 --- a/meson.build +++ b/meson.build @@ -50,8 +50,6 @@ endif # some improvements cflags += ['-fno-plt', '-flto', '-isystem', '-fvisibility=hidden', '-DVALA_EXTERN=extern', '-pthread'] -libc_srcs = [] - start_code = [] # do not include glibc or musl stdlib and link with glibc or musl @@ -145,21 +143,11 @@ else endif # find sources -sources = ['src/ymp.vala', - 'src/settings.vala', - 'src/operations.vala', - 'src/process.vala', - 'src/interpreter.vala', - 'src/wslblock.vala', - 'src/ccode.vala', - 'data/ymp-extra.h' - ] -sources += run_command('find', 'src/util','-type','f',check:true).stdout().strip().split('\n') -sources += run_command('find', 'src/operations','-type','f',check:true).stdout().strip().split('\n') -sources += run_command('find', 'src/data','-type','f',check:true).stdout().strip().split('\n') - - -foreach csource : run_command('find', 'src/ccode','-type','f',check:true).stdout().strip().split('\n') +sources = ['data/ymp-extra.h'] +sources += run_command('find', 'src/', '-not', '-path', 'src/cli/*','-type','f', '-iname', '*.vala',check:true).stdout().strip().split('\n') + +# find C sources +foreach csource : run_command('find', 'src/', '-not', '-path', 'src/cli/*','-type','f', '-iname', '*.c' ,check:true).stdout().strip().split('\n') sources += [meson.current_source_dir() / csource] endforeach @@ -257,11 +245,11 @@ install_data(meson.current_build_dir() / 'libymp.so', install_dir : get_option(' ########### build tools ########### if get_option('tools') # ymp cli - cli = executable('ymp-cli', ['src/cli/main.c'] + start_code, libc_srcs, dependencies: deps, link_args: ldflags , link_with: libymp) + cli = executable('ymp-cli', ['src/cli/main.c'] + start_code, dependencies: deps, link_args: ldflags , link_with: libymp) install_data(meson.current_build_dir() / 'ymp-cli', install_dir : get_option('bindir'),rename : 'ymp') # ymp shell - shell = executable('ymp-shell', ['src/cli/shell.c'] + start_code, libc_srcs, dependencies: deps, link_args: ldflags, link_with: libymp) + shell = executable('ymp-shell', ['src/cli/shell.c'] + start_code, dependencies: deps, link_args: ldflags, link_with: libymp) install_data(meson.current_build_dir() / 'ymp-shell', install_dir : get_option('bindir'),rename : 'ympsh') endif