| 1 |
project('comparer', 'c') |
| 2 |
|
| 3 |
# Added manually as a c_arg to test handling of include paths with backslashes |
| 4 |
# and spaces. This is especially useful on Windows in vcxproj files since it |
| 5 |
# stores include directories in a separate element that has its own |
| 6 |
# context-specific escaping/quoting. |
| 7 |
include_dir = meson.current_source_dir() + '/include' |
| 8 |
default_c_args = ['-I' + include_dir] |
| 9 |
|
| 10 |
if meson.get_compiler('c').get_argument_syntax() == 'msvc' |
| 11 |
default_c_args += ['/Faasm output\\'] |
| 12 |
# Hack to create the 'asm output' directory in the builddir |
| 13 |
subdir('asm output') |
| 14 |
endif |
| 15 |
|
| 16 |
# Path can contain \. Here we're sending `"foo\bar"`. |
| 17 |
test('backslash quoting', |
| 18 |
executable('comparer', 'comparer.c', |
| 19 |
c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar"'])) |
| 20 |
# Path can end in \ without any special quoting. Here we send `"foo\bar\"`. |
| 21 |
test('backslash end quoting', |
| 22 |
executable('comparer-end', 'comparer-end.c', |
| 23 |
c_args : default_c_args + ['-DDEF_WITH_BACKSLASH="foo\\bar\\"'])) |
| 24 |
# Path can (really) end in \ if we're not passing a string literal without any |
| 25 |
# special quoting. Here we're sending `foo\bar\`. |
| 26 |
test('backslash end quoting when not a string literal', |
| 27 |
executable('comparer-end-notstring', 'comparer-end-notstring.c', |
| 28 |
c_args : default_c_args + ['-DDEF_WITH_BACKSLASH=foo\\bar\\'])) |