From: Seunghun Lee Date: Thu, 15 Sep 2022 05:34:10 +0000 (+0900) Subject: Add libshared static library X-Git-Tag: accepted/tizen/unified/20230106.165108~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bd3b0c34470d0c0478978205086733421a1e80b;p=platform%2Fcore%2Fuifw%2Flibds-tizen.git Add libshared static library The libshared library is to be used for shared functionalities. For now, it only provides converting pixel format functionality for both tbm_server and video implementation, but it will be expanded as needed. Video implementation will use it in a future patch. Change-Id: I94d7cd6479abbdcc4e0860fb41c878b96ac9296e --- diff --git a/meson.build b/meson.build index d6804fe..5446b25 100644 --- a/meson.build +++ b/meson.build @@ -19,7 +19,6 @@ dir_prefix = get_option('prefix') libds_tizen_bindir = join_paths(dir_prefix, get_option('bindir')) libds_tizen_inc = include_directories('include') -common_inc = [ include_directories('.'), libds_tizen_inc ] cdata = configuration_data() cdata.set('LIBDS_VERSION_MAJOR', libds_tizen_version_major) diff --git a/src/meson.build b/src/meson.build index f067865..23fd5c0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,3 +1,5 @@ +common_inc = [ include_directories('.'), libds_tizen_inc ] + math = meson.get_compiler('c').find_library('m') wayland_server = dependency('wayland-server', required: true) rt = meson.get_compiler('c').find_library('rt') @@ -11,10 +13,12 @@ deps_base = [ rt, ] +dep_libds = dependency('libds', required: true) + deps_libds_tizen = [ deps_base, wayland_server, - dependency('libds', required: true), + dep_libds, ] tizen_security_files = [ @@ -27,6 +31,7 @@ deps_tizen_security = [ dependency('libsmack', required: true) ] +subdir('shared') subdir('allocator') subdir('tbm_server') subdir('backend') diff --git a/src/shared/meson.build b/src/shared/meson.build new file mode 100644 index 0000000..c7550ec --- /dev/null +++ b/src/shared/meson.build @@ -0,0 +1,22 @@ +libshared_srcs = [ + 'pixel_format.c', +] + +libshared_deps = [ + dep_libds, + dependency('libdrm', required: true), + dependency('libtbm', required: true), +] + +lib_libshared = static_library( + 'shared', + libshared_srcs, + dependencies: libshared_deps, + pic: true, + install: false, +) + +dep_libshared = declare_dependency( + link_with: lib_libshared, + dependencies: libshared_deps, +) diff --git a/src/tbm_server/pixel_format.c b/src/shared/pixel_format.c similarity index 100% rename from src/tbm_server/pixel_format.c rename to src/shared/pixel_format.c diff --git a/src/tbm_server/pixel_format.h b/src/shared/pixel_format.h similarity index 100% rename from src/tbm_server/pixel_format.h rename to src/shared/pixel_format.h diff --git a/src/tbm_server/meson.build b/src/tbm_server/meson.build index 795576a..e41528f 100644 --- a/src/tbm_server/meson.build +++ b/src/tbm_server/meson.build @@ -1,11 +1,10 @@ libds_tizen_tbm_server_files = [ - 'pixel_format.c', 'tbm_server.c', ] libds_tizen_tbm_server_deps = [ deps_libds_tizen, - dependency('libdrm', required: true), + dep_libshared, dependency('libtbm', required: true), dependency('wayland-tbm-server', required: true), ] diff --git a/src/tbm_server/tbm_server.c b/src/tbm_server/tbm_server.c index 3ae411d..28ec9b5 100644 --- a/src/tbm_server/tbm_server.c +++ b/src/tbm_server/tbm_server.c @@ -5,7 +5,7 @@ #include #include -#include "pixel_format.h" +#include "shared/pixel_format.h" #include "tbm_server.h" static const struct ds_buffer_resource_interface tbm_buffer_resource_iface;