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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5018>
This commit is contained in:
Nirbheek Chauhan 2023-07-12 09:27:22 +05:30 committed by GStreamer Marge Bot
parent ae73284a2d
commit 8e1b6accbd
10 changed files with 24 additions and 14 deletions

View file

@ -9,11 +9,12 @@ validate_tests = [
['validate/expression_parser'], ['validate/expression_parser'],
] ]
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', '-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', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -25,12 +25,13 @@ ges_tests = [
['nle/tempochange'] ['nle/tempochange']
] ]
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-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"', '-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', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -8,11 +8,12 @@ libav_tests = [
[ 'generic/plugin-test' ] [ 'generic/plugin-test' ]
] ]
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', '-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', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -162,13 +162,14 @@ if host_machine.system() == 'linux'
] ]
endif endif
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', '-DGST_TEST_FILES_PATH="' + fsmod.as_posix(meson.current_source_dir()) + '/../files"',
'-DTEST_PATH="' + meson.current_build_dir() + '/media"', '-DTEST_PATH="' + fsmod.as_posix(meson.current_build_dir()) + '/media"',
'-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data', '-DDASH_MPD_DATADIR=' + fsmod.as_posix(meson.current_source_dir()) + '/elements/dash_mpd_data',
'-DGST_USE_UNSTABLE_API', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -1,9 +1,10 @@
gtk_dep = dependency('gtk+-3.0', required : get_option('examples')) gtk_dep = dependency('gtk+-3.0', required : get_option('examples'))
gdk_x11_dep = dependency('gdk-x11-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() if gtk_dep.found() and gdk_x11_dep.found()
fsmod = import('fs')
camera2_args = [ camera2_args = [
'-DGST_USE_UNSTABLE_API', '-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'), cc.get_supported_link_arguments('-fvisibility=default'),
] ]
gmodule_export_dep = dependency('gmodule-export-2.0') gmodule_export_dep = dependency('gmodule-export-2.0')

View file

@ -119,12 +119,13 @@ if have_cxx
] ]
endif endif
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', '-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_TEST_FILE="' + meson.current_source_dir() + '/../files/partialframe.mjpeg"', # for libs/discoverer '-DGST_TEST_FILE="' + fsmod.as_posix(meson.current_source_dir()) + '/../files/partialframe.mjpeg"', # for libs/discoverer
'-DGST_USE_UNSTABLE_API', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -158,11 +158,12 @@ if host_machine.system() != 'windows'
] ]
endif endif
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', '-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', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -11,11 +11,12 @@ if host_machine.system() != 'windows'
] ]
endif endif
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', '-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', '-DGST_USE_UNSTABLE_API',
] ]

View file

@ -13,11 +13,12 @@ else
endif endif
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner') gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
fsmod = import('fs')
test_c_args = [ test_c_args = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"', '-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 = [ rtsp_server_tests = [

View file

@ -120,11 +120,12 @@ if add_languages('cpp', native: false, required: false)
] ]
endif endif
fsmod = import('fs')
test_defines = [ test_defines = [
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS', '-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', '-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', '-DGST_DISABLE_DEPRECATED',
] ]