From 8e1b6accbdb839efa8a2b0c3a87451efe226fb7e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 12 Jul 2023 09:27:22 +0530 Subject: [PATCH] meson: Always use forward slashes in defines with paths Fixes the following build failure on MSYS2: ``` ../subprojects/gstreamer/tests/check/elements/filesrc.c: In function 'test_seeking': ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: error: incomplete universal character name \U 107 | g_object_set (G_OBJECT (src), "location", TESTFILE, NULL); | ^ ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\A' ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g' ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\s' ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g' ../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\c' ``` Due to: `-DTESTFILE=\"C:\\Users\\Administrator\[...]` https://gitlab.freedesktop.org/nirbheek/gstreamer/-/jobs/45317733 Part-of: --- subprojects/gst-devtools/validate/tests/check/meson.build | 3 ++- subprojects/gst-editing-services/tests/check/meson.build | 5 +++-- subprojects/gst-libav/tests/check/meson.build | 3 ++- subprojects/gst-plugins-bad/tests/check/meson.build | 7 ++++--- .../gst-plugins-bad/tests/examples/camerabin2/meson.build | 3 ++- subprojects/gst-plugins-base/tests/check/meson.build | 5 +++-- subprojects/gst-plugins-good/tests/check/meson.build | 3 ++- subprojects/gst-plugins-ugly/tests/check/meson.build | 3 ++- subprojects/gst-rtsp-server/tests/check/meson.build | 3 ++- subprojects/gstreamer/tests/check/meson.build | 3 ++- 10 files changed, 24 insertions(+), 14 deletions(-) diff --git a/subprojects/gst-devtools/validate/tests/check/meson.build b/subprojects/gst-devtools/validate/tests/check/meson.build index 2960a43a66..47fdf3e307 100644 --- a/subprojects/gst-devtools/validate/tests/check/meson.build +++ b/subprojects/gst-devtools/validate/tests/check/meson.build @@ -9,11 +9,12 @@ validate_tests = [ ['validate/expression_parser'], ] +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', - '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"', + '-DTESTFILE="' + fsmod.as_posix(meson.current_source_dir()) + '/meson.build"', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-editing-services/tests/check/meson.build b/subprojects/gst-editing-services/tests/check/meson.build index 267a84b9f2..a283f0371b 100644 --- a/subprojects/gst-editing-services/tests/check/meson.build +++ b/subprojects/gst-editing-services/tests/check/meson.build @@ -25,12 +25,13 @@ ges_tests = [ ['nle/tempochange'] ] +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', - '-DGES_TEST_FILES_PATH="@0@"'.format(join_paths(meson.current_source_dir(), 'assets')), + '-DGES_TEST_FILES_PATH="@0@"'.format(fsmod.as_posix(join_paths(meson.current_source_dir(), 'assets'))), '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', - '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"', + '-DTESTFILE="' + fsmod.as_posix(meson.current_source_dir()) + '/meson.build"', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-libav/tests/check/meson.build b/subprojects/gst-libav/tests/check/meson.build index 2ba3714375..81912ba471 100644 --- a/subprojects/gst-libav/tests/check/meson.build +++ b/subprojects/gst-libav/tests/check/meson.build @@ -8,11 +8,12 @@ libav_tests = [ [ 'generic/plugin-test' ] ] +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-plugins-bad/tests/check/meson.build b/subprojects/gst-plugins-bad/tests/check/meson.build index 1f5b6ad13f..bcd7c4d0de 100644 --- a/subprojects/gst-plugins-bad/tests/check/meson.build +++ b/subprojects/gst-plugins-bad/tests/check/meson.build @@ -162,13 +162,14 @@ if host_machine.system() == 'linux' ] endif +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', - '-DTEST_PATH="' + meson.current_build_dir() + '/media"', - '-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data', + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', + '-DTEST_PATH="' + fsmod.as_posix(meson.current_build_dir()) + '/media"', + '-DDASH_MPD_DATADIR=' + fsmod.as_posix(meson.current_source_dir()) + '/elements/dash_mpd_data', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-plugins-bad/tests/examples/camerabin2/meson.build b/subprojects/gst-plugins-bad/tests/examples/camerabin2/meson.build index 3db3db12ca..4cbb404081 100644 --- a/subprojects/gst-plugins-bad/tests/examples/camerabin2/meson.build +++ b/subprojects/gst-plugins-bad/tests/examples/camerabin2/meson.build @@ -1,9 +1,10 @@ gtk_dep = dependency('gtk+-3.0', required : get_option('examples')) gdk_x11_dep = dependency('gdk-x11-3.0', required : get_option('examples')) if gtk_dep.found() and gdk_x11_dep.found() + fsmod = import('fs') camera2_args = [ '-DGST_USE_UNSTABLE_API', - '-DCAMERA_APPS_UIDIR="@0@"'.format(meson.current_source_dir()), + '-DCAMERA_APPS_UIDIR="@0@"'.format(fsmod.as_posix(meson.current_source_dir())), cc.get_supported_link_arguments('-fvisibility=default'), ] gmodule_export_dep = dependency('gmodule-export-2.0') diff --git a/subprojects/gst-plugins-base/tests/check/meson.build b/subprojects/gst-plugins-base/tests/check/meson.build index 50d4cbbfe6..5cacd9151a 100644 --- a/subprojects/gst-plugins-base/tests/check/meson.build +++ b/subprojects/gst-plugins-base/tests/check/meson.build @@ -119,12 +119,13 @@ if have_cxx ] endif +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', - '-DGST_TEST_FILE="' + meson.current_source_dir() + '/../files/partialframe.mjpeg"', # for libs/discoverer + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', + '-DGST_TEST_FILE="' + fsmod.as_posix(meson.current_source_dir()) + '/../files/partialframe.mjpeg"', # for libs/discoverer '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-plugins-good/tests/check/meson.build b/subprojects/gst-plugins-good/tests/check/meson.build index 3a52590d68..02a5cee874 100644 --- a/subprojects/gst-plugins-good/tests/check/meson.build +++ b/subprojects/gst-plugins-good/tests/check/meson.build @@ -158,11 +158,12 @@ if host_machine.system() != 'windows' ] endif +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-plugins-ugly/tests/check/meson.build b/subprojects/gst-plugins-ugly/tests/check/meson.build index c22a6d66f4..d703524c52 100644 --- a/subprojects/gst-plugins-ugly/tests/check/meson.build +++ b/subprojects/gst-plugins-ugly/tests/check/meson.build @@ -11,11 +11,12 @@ if host_machine.system() != 'windows' ] endif +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', '-DGST_USE_UNSTABLE_API', ] diff --git a/subprojects/gst-rtsp-server/tests/check/meson.build b/subprojects/gst-rtsp-server/tests/check/meson.build index 229af32f81..ca658f9dda 100644 --- a/subprojects/gst-rtsp-server/tests/check/meson.build +++ b/subprojects/gst-rtsp-server/tests/check/meson.build @@ -13,11 +13,12 @@ else endif gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner') +fsmod = import('fs') test_c_args = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', - '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', + '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"', ] rtsp_server_tests = [ diff --git a/subprojects/gstreamer/tests/check/meson.build b/subprojects/gstreamer/tests/check/meson.build index 9787b0a0dd..65402791aa 100644 --- a/subprojects/gstreamer/tests/check/meson.build +++ b/subprojects/gstreamer/tests/check/meson.build @@ -120,11 +120,12 @@ if add_languages('cpp', native: false, required: false) ] endif +fsmod = import('fs') test_defines = [ '-UG_DISABLE_ASSERT', '-UG_DISABLE_CAST_CHECKS', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', - '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"', + '-DTESTFILE="' + fsmod.as_posix(meson.current_source_dir()) + '/meson.build"', '-DGST_DISABLE_DEPRECATED', ]