util/meson: Getting mesa util core to be self contained
Guard util to be standalone by move subdir('util') just behind subdir('android_stub') texcompress_rgtc_tmp.h is not a standard c header, do not treat it as source Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
inc_util_c11 = [include_directories('../..')]
|
||||
|
||||
files_mesa_util_c11 = files(
|
||||
'time.c',
|
||||
)
|
||||
@@ -34,7 +36,7 @@ endif
|
||||
_libmesa_util_c11 = static_library(
|
||||
'mesa_util_c11',
|
||||
[files_mesa_util_c11],
|
||||
include_directories : [inc_include, inc_src],
|
||||
include_directories : inc_util_c11,
|
||||
c_args : [c_msvc_compat_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false
|
||||
@@ -42,6 +44,6 @@ _libmesa_util_c11 = static_library(
|
||||
|
||||
idep_mesautilc11 = declare_dependency(
|
||||
link_with : _libmesa_util_c11,
|
||||
include_directories : [inc_include, inc_src],
|
||||
include_directories : inc_util_c11,
|
||||
dependencies : [dep_clock, dep_thread, dep_atomic, dep_m, dep_valgrind],
|
||||
)
|
||||
|
@@ -33,7 +33,7 @@ libopengl32 = shared_library(
|
||||
['stw_wgl.c'],
|
||||
vs_module_defs : opengl32_def,
|
||||
include_directories : [
|
||||
inc_include, inc_wgl, inc_src,
|
||||
inc_include, inc_wgl, inc_src, inc_gallium,
|
||||
],
|
||||
link_with : [
|
||||
libgallium_wgl, libglapi_bridge, libglapi
|
||||
|
@@ -18,6 +18,11 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
subdir('gtest')
|
||||
subdir('c11/impl')
|
||||
subdir('android_stub')
|
||||
subdir('util')
|
||||
|
||||
inc_mesa = include_directories('mesa')
|
||||
inc_mapi = include_directories('mapi')
|
||||
inc_src = include_directories('.')
|
||||
@@ -53,15 +58,11 @@ sha1_h = custom_target(
|
||||
build_always_stale : true, # commit sha1 can change without having touched these files
|
||||
)
|
||||
|
||||
subdir('gtest')
|
||||
if cc.get_argument_syntax() == 'msvc'
|
||||
subdir('getopt')
|
||||
else
|
||||
idep_getopt = null_dep
|
||||
endif
|
||||
subdir('android_stub')
|
||||
subdir('c11/impl')
|
||||
subdir('util')
|
||||
if with_gallium
|
||||
subdir('mapi')
|
||||
endif
|
||||
|
@@ -18,7 +18,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
files_mesa_format = [
|
||||
files_mesa_format = files(
|
||||
'u_format.c',
|
||||
'u_format_bptc.c',
|
||||
'u_format_etc.c',
|
||||
@@ -31,7 +31,7 @@ files_mesa_format = [
|
||||
'u_format_unpack_neon.c',
|
||||
'u_format_yuv.c',
|
||||
'u_format_zs.c',
|
||||
]
|
||||
)
|
||||
|
||||
# TODO: remove the quirk when GCC get test and fix inside release
|
||||
# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108163
|
||||
@@ -58,14 +58,4 @@ u_format_table_c = custom_target(
|
||||
capture : true,
|
||||
)
|
||||
|
||||
libmesa_format = static_library(
|
||||
'mesa_format',
|
||||
[files_mesa_format, u_format_table_c, u_format_pack_h],
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
# NOTE dep_valgrind used here instead of idep_mesautil due to chicken/egg
|
||||
# dependencies between util and util/format
|
||||
dependencies : [dep_m, dep_valgrind],
|
||||
c_args : [c_msvc_compat_args, arm_neon_workaround],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false
|
||||
)
|
||||
files_mesa_format += [u_format_pack_h, u_format_table_c]
|
||||
|
@@ -24,7 +24,6 @@
|
||||
inc_util = [inc_include, include_directories('..')]
|
||||
|
||||
subdir('blake3')
|
||||
subdir('format')
|
||||
|
||||
files_mesa_util = files(
|
||||
'anon_file.h',
|
||||
@@ -124,7 +123,6 @@ files_mesa_util = files(
|
||||
'strndup.h',
|
||||
'strtod.c',
|
||||
'strtod.h',
|
||||
'texcompress_rgtc_tmp.h',
|
||||
'timespec.h',
|
||||
'u_atomic.c',
|
||||
'u_atomic.h',
|
||||
@@ -256,16 +254,20 @@ libmesa_util_sse41 = static_library(
|
||||
'mesa_util_sse41',
|
||||
files('streaming-load-memcpy.c'),
|
||||
c_args : [c_msvc_compat_args, sse41_args],
|
||||
include_directories : [inc_include, inc_src, inc_mesa],
|
||||
include_directories : [inc_util],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
# subdir format provide files_mesa_format
|
||||
subdir('format')
|
||||
files_mesa_util += files_mesa_format
|
||||
|
||||
_libmesa_util = static_library(
|
||||
'mesa_util',
|
||||
[files_mesa_util, files_debug_stack, format_srgb],
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
include_directories : [inc_util, include_directories('format')],
|
||||
dependencies : deps_for_libmesa_util,
|
||||
link_with: [libmesa_format, libmesa_util_sse41],
|
||||
link_with: [libmesa_util_sse41],
|
||||
c_args : [c_msvc_compat_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false
|
||||
@@ -273,7 +275,7 @@ _libmesa_util = static_library(
|
||||
|
||||
idep_mesautil = declare_dependency(
|
||||
link_with : _libmesa_util,
|
||||
include_directories : [inc_util, inc_gallium],
|
||||
include_directories : [inc_util],
|
||||
dependencies : deps_for_libmesa_util,
|
||||
)
|
||||
|
||||
@@ -293,7 +295,6 @@ c_xmlconfig_arg = '-DWITH_XMLCONFIG=@0@'.format(use_xmlconfig.to_int())
|
||||
_libxmlconfig = static_library(
|
||||
'xmlconfig',
|
||||
files_xmlconfig,
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
dependencies : [idep_mesautil, dep_m, xmlconfig_deps],
|
||||
c_args : [
|
||||
c_msvc_compat_args,
|
||||
@@ -324,7 +325,6 @@ if with_tests
|
||||
test('xmlconfig',
|
||||
executable('xmlconfig_test',
|
||||
files('tests/xmlconfig.cpp'),
|
||||
include_directories : [inc_include, inc_src],
|
||||
dependencies : [idep_mesautil, idep_xmlconfig, idep_gtest],
|
||||
override_options : ['cpp_std=c++2a'],
|
||||
cpp_args: ['-Wno-write-strings', c_xmlconfig_arg]
|
||||
@@ -383,7 +383,6 @@ if with_tests
|
||||
executable(
|
||||
'util_tests',
|
||||
files_util_tests,
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
dependencies : [idep_mesautil, idep_gtest],
|
||||
),
|
||||
suite : ['util'],
|
||||
@@ -394,7 +393,6 @@ if with_tests
|
||||
process_test_exe = executable(
|
||||
'process_test',
|
||||
files('tests/process_test.c'),
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
dependencies : idep_mesautil,
|
||||
c_args : [c_msvc_compat_args],
|
||||
)
|
||||
|
@@ -3,7 +3,6 @@ foreach t : ['srgb', 'u_format_test', 'u_format_compatible_test']
|
||||
executable(
|
||||
t,
|
||||
'@0@.c'.format(t),
|
||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
||||
dependencies : idep_mesautil,
|
||||
),
|
||||
suite : 'format',
|
||||
|
@@ -29,7 +29,6 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 'delete_management',
|
||||
files('@0@.c'.format(t)),
|
||||
c_args : [c_msvc_compat_args],
|
||||
dependencies : idep_mesautil,
|
||||
include_directories : [inc_include, inc_util],
|
||||
),
|
||||
suite : ['util'],
|
||||
)
|
||||
|
@@ -23,7 +23,6 @@ test(
|
||||
executable(
|
||||
'vma_random_test',
|
||||
'vma_random_test.cpp',
|
||||
include_directories : [inc_include, inc_util],
|
||||
dependencies : idep_mesautil,
|
||||
),
|
||||
suite : ['util'],
|
||||
|
Reference in New Issue
Block a user