From: Seunghun Lee Date: Wed, 16 Mar 2022 02:43:49 +0000 (+0900) Subject: Add directories for tizen features X-Git-Tag: accepted/tizen/unified/20220720.034120~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=014278c3fb19ac4c21a074ad1f745bd1595b3359;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git Add directories for tizen features Change-Id: Ie629354a2c689293b678cc9cc4d22227a5068a94 --- diff --git a/include/libds/allocator/tbm.h b/include/libds-tizen/allocator/tbm.h similarity index 76% rename from include/libds/allocator/tbm.h rename to include/libds-tizen/allocator/tbm.h index c02aee3..3febb10 100644 --- a/include/libds/allocator/tbm.h +++ b/include/libds-tizen/allocator/tbm.h @@ -1,5 +1,5 @@ -#ifndef LIBDS_ALLOCATOR_TBM_H -#define LIBDS_ALLOCATOR_TBM_H +#ifndef LIBDS_TIZEN_ALLOCATOR_TBM_H +#define LIBDS_TIZEN_ALLOCATOR_TBM_H #include diff --git a/include/libds/backend/tdm.h b/include/libds-tizen/backend/tdm.h similarity index 72% rename from include/libds/backend/tdm.h rename to include/libds-tizen/backend/tdm.h index e697413..d2785b2 100644 --- a/include/libds/backend/tdm.h +++ b/include/libds-tizen/backend/tdm.h @@ -1,5 +1,5 @@ -#ifndef LIBDS_BACKEND_TDM_H -#define LIBDS_BACKEND_TDM_H +#ifndef LIBDS_TIZEN_BACKEND_TDM_H +#define LIBDS_TIZEN_BACKEND_TDM_H #include diff --git a/include/meson.build b/include/meson.build index f273424..0975c5d 100644 --- a/include/meson.build +++ b/include/meson.build @@ -1,13 +1,9 @@ -exclude_files = [] -if not features.get('tdm-backend') - exclude_files += 'backend/tdm.h' -endif - -if not features.get('tbm-allocator') - exclude_files += 'allocator/tbm.h' -endif - install_subdir('libds', install_dir: get_option('includedir'), - exclude_files: exclude_files, ) + +if get_option('tizen') + install_subdir('libds-tizen', + install_dir: get_option('includedir'), + ) +endif diff --git a/meson.build b/meson.build index 0e4e5c0..d3d2df0 100644 --- a/meson.build +++ b/meson.build @@ -25,14 +25,7 @@ cdata.set('LIBDS_VERSION_MAJOR', libds_version_major) cdata.set('LIBDS_VERSION_MINOR', libds_version_minor) cdata.set('LIBDS_VERSION_PATCH', libds_version_patch) -features = { - 'tdm-backend': false, - 'tbm-allocator': false, -} - subdir('src') subdir('include') configure_file(output: 'config.h', install: false, configuration: cdata) - -summary(features, bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 02af9b0..6ef6c8e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1 @@ -option('backends', type: 'array', choices: ['auto', 'tdm'], value: ['auto'], description: 'Select built-in backends') +option('tizen', type: 'boolean', value: false, description: 'Build Tizen features') diff --git a/packaging/libds.spec b/packaging/libds.spec index bd38de7..879a87d 100644 --- a/packaging/libds.spec +++ b/packaging/libds.spec @@ -30,6 +30,12 @@ Requires: %{name} = %{version}-%{release} %description devel Development package of Wayland Compositor Library +%package tizen-devel +Summary: Wayland Compositor development package on Tizen + +%description tizen-devel +Wayland Compositor development library for Tizen platform + %prep %setup -q cp %{SOURCE1001} . @@ -39,7 +45,8 @@ meson setup \ --prefix /usr \ --libdir %{_libdir} \ --bindir %{_bindir} \ - builddir + builddir \ + -Dtizen=true ninja -C builddir all %install @@ -56,7 +63,19 @@ ninja -C builddir install %manifest %{name}.manifest %defattr(-,root,root,-) %license LICENSE -%{_includedir}/* +%{_includedir}/libds/* %{_libdir}/pkgconfig/libds.pc %{_libdir}/libds.so -%{_bindir}/* +%{_bindir}/wl-backend +%{_bindir}/tinyds + +%files tizen-devel +%manifest %{name}.manifest +%defattr(-,root,root,-) +%license LICENSE +%{_includedir}/libds-tizen/* +%{_libdir}/pkgconfig/libds-tizen.pc +%{_libdir}/libds-tizen.so +%{_bindir}/tdm-backend +%{_bindir}/tinyds-tdm +%{_bindir}/ds-simple-tbm diff --git a/src/examples/meson.build b/src/examples/meson.build index 193b4a5..f95bd50 100644 --- a/src/examples/meson.build +++ b/src/examples/meson.build @@ -23,7 +23,9 @@ executable('tinyds', install : true ) -if features.get('tdm-backend') +if get_option('tizen') + common_deps += dep_libds_tizen + executable('tdm-backend', 'tdm-backend.c', dependencies: common_deps, diff --git a/src/examples/tdm-backend.c b/src/examples/tdm-backend.c index ee39f06..ba3fecb 100644 --- a/src/examples/tdm-backend.c +++ b/src/examples/tdm-backend.c @@ -8,10 +8,10 @@ #include #include #include -#include -#include #include #include +#include +#include #define WIDTH 1280 #define HEIGHT 720 diff --git a/src/examples/tinyds-tdm.c b/src/examples/tinyds-tdm.c index 2c91a66..143d53e 100644 --- a/src/examples/tinyds-tdm.c +++ b/src/examples/tinyds-tdm.c @@ -14,11 +14,11 @@ #include #include #include -#include -#include #include #include #include +#include +#include #define TINYDS_UNUSED __attribute__((unused)) diff --git a/src/libds-tizen/allocator/meson.build b/src/libds-tizen/allocator/meson.build new file mode 100644 index 0000000..fe869bd --- /dev/null +++ b/src/libds-tizen/allocator/meson.build @@ -0,0 +1,2 @@ +libds_tizen_files += files('tbm.c') +libds_tizen_deps += dependency('libtbm', required: true) diff --git a/src/libds/allocator/tbm.c b/src/libds-tizen/allocator/tbm.c similarity index 100% rename from src/libds/allocator/tbm.c rename to src/libds-tizen/allocator/tbm.c diff --git a/src/libds-tizen/backend/meson.build b/src/libds-tizen/backend/meson.build new file mode 100644 index 0000000..8a05e13 --- /dev/null +++ b/src/libds-tizen/backend/meson.build @@ -0,0 +1 @@ +subdir('tdm') diff --git a/src/libds/backend/tdm/backend.c b/src/libds-tizen/backend/tdm/backend.c similarity index 100% rename from src/libds/backend/tdm/backend.c rename to src/libds-tizen/backend/tdm/backend.c diff --git a/src/libds-tizen/backend/tdm/meson.build b/src/libds-tizen/backend/tdm/meson.build new file mode 100644 index 0000000..39ffceb --- /dev/null +++ b/src/libds-tizen/backend/tdm/meson.build @@ -0,0 +1,12 @@ +libds_tizen_files += files( + 'backend.c', + 'output.c', +) + +libtdm = dependency('libtdm', required: true) +libtbm = dependency('libtbm', required: true) + +libds_tizen_deps += [ + libtdm, + libtbm +] diff --git a/src/libds/backend/tdm/output.c b/src/libds-tizen/backend/tdm/output.c similarity index 99% rename from src/libds/backend/tdm/output.c rename to src/libds-tizen/backend/tdm/output.c index 5148853..f6b6250 100644 --- a/src/libds/backend/tdm/output.c +++ b/src/libds-tizen/backend/tdm/output.c @@ -4,7 +4,7 @@ #include #include "libds/log.h" -#include "libds/allocator/tbm.h" +#include "libds-tizen/allocator/tbm.h" #include "tdm.h" diff --git a/src/libds/backend/tdm/tdm.h b/src/libds-tizen/backend/tdm/tdm.h similarity index 95% rename from src/libds/backend/tdm/tdm.h rename to src/libds-tizen/backend/tdm/tdm.h index 1c80ef9..275089c 100644 --- a/src/libds/backend/tdm/tdm.h +++ b/src/libds-tizen/backend/tdm/tdm.h @@ -1,5 +1,5 @@ -#ifndef DS_BACKEND_TDM_H -#define DS_BACKEND_TDM_H +#ifndef DS_TIZEN_BACKEND_TDM_H +#define DS_TIZEN_BACKEND_TDM_H #include diff --git a/src/libds-tizen/meson.build b/src/libds-tizen/meson.build new file mode 100644 index 0000000..e9ca734 --- /dev/null +++ b/src/libds-tizen/meson.build @@ -0,0 +1,29 @@ +libds_tizen_files = [] + +libds_tizen_deps = [ + dep_libds, +] + +subdir('allocator') +subdir('backend') + +lib_libds_tizen = shared_library('ds-tizen', libds_tizen_files, + dependencies: libds_tizen_deps, + include_directories: [ common_inc, include_directories('.') ], + version: meson.project_version(), + install: true +) + +dep_libds_tizen = declare_dependency( + link_with: lib_libds_tizen, + dependencies: libds_tizen_deps, + include_directories: [ common_inc, include_directories('.') ], +) + +pkgconfig = import('pkgconfig') +pkgconfig.generate(lib_libds_tizen, + version: meson.project_version(), + filebase: 'libds-tizen', + name: 'libds-tizen', + description: 'extension of libds for tizen platform', +) diff --git a/src/libds/allocator/meson.build b/src/libds/allocator/meson.build index 361f96e..173c219 100644 --- a/src/libds/allocator/meson.build +++ b/src/libds/allocator/meson.build @@ -1,12 +1 @@ libds_files += files('shm.c') - -libtbm = dependency( - 'libtbm', - required: false, - not_found_message: 'Required for TBM allocator support.' -) -if libtbm.found() - libds_files += files('tbm.c') - libds_deps += libtbm - features += { 'tbm-allocator': true } -endif diff --git a/src/libds/backend/meson.build b/src/libds/backend/meson.build index b1fff87..895ffca 100644 --- a/src/libds/backend/meson.build +++ b/src/libds/backend/meson.build @@ -1,15 +1 @@ -all_backends = ['tdm'] -backends = get_option('backends') -if 'auto' in backends and get_option('auto_features').enabled() - backends = all_backends -elif 'auto' in backends and get_option('auto_features').disabled() - backends = [] -endif - -foreach backend : all_backends - if backend in backends or 'auto' in backends - subdir(backend) - endif -endforeach - subdir('wayland') diff --git a/src/libds/backend/tdm/meson.build b/src/libds/backend/tdm/meson.build deleted file mode 100644 index 82eb165..0000000 --- a/src/libds/backend/tdm/meson.build +++ /dev/null @@ -1,32 +0,0 @@ -msg = ['Required for TDM backend support.'] -if 'tdm' in backends - msg += 'Install "libtdm" and "libtbm", or disable the tdm backend' -endif - -libtdm = dependency( - 'libtdm', - required: 'tdm' in backends, - not_found_message: '\n'.join(msg) -) - -libtbm = dependency( - 'libtbm', - required: 'tdm' in backends, - not_found_message: '\n'.join(msg) -) - -if not libtdm.found() or not libtbm.found() - subdir_done() -endif - -libds_files += files( - 'backend.c', - 'output.c', -) - -libds_deps += [ - libtdm, - libtbm -] - -features += { 'tdm-backend': true } diff --git a/src/libds/meson.build b/src/libds/meson.build index ed8c95f..50f7962 100644 --- a/src/libds/meson.build +++ b/src/libds/meson.build @@ -68,16 +68,10 @@ lib_libds = shared_library('ds', libds_files, install: true ) -ds_vars = {} -foreach name, have : features - ds_vars += { 'have_' + name.underscorify(): have.to_string() } -endforeach - dep_libds = declare_dependency( link_with: lib_libds, dependencies: libds_deps, include_directories: [ common_inc, include_directories('.') ], - variables: ds_vars, ) pkgconfig = import('pkgconfig') @@ -86,5 +80,4 @@ pkgconfig.generate(lib_libds, filebase: meson.project_name(), name: meson.project_name(), description: 'Wayland compositor library', - variables: ds_vars, ) diff --git a/src/meson.build b/src/meson.build index 774c7eb..d739bfe 100644 --- a/src/meson.build +++ b/src/meson.build @@ -11,6 +11,9 @@ wayland_scanner = find_program( ) subdir('libds') +if get_option('tizen') + subdir('libds-tizen') +endif subdir('tests') subdir('examples') subdir('clients')