build: Skip building some tests on MSVC for now This is a stopgap measure to quickly get tests building with MSVC for now, at some point the tests could be rewritten to avoid using getopt() and mkdtemp() or to ship an implementation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/meson.build b/meson.build
index d8b9430..a43fc0c 100644
--- a/meson.build
+++ b/meson.build
@@ -344,11 +344,14 @@ test(
executable('test-filecomp', 'test/filecomp.c', dependencies: test_dep),
env: test_env,
)
-test(
- 'context',
- executable('test-context', 'test/context.c', dependencies: test_dep),
- env: test_env,
-)
+# TODO: This test currently uses some functions that don't exist on Windows.
+if cc.get_id() != 'msvc'
+ test(
+ 'context',
+ executable('test-context', 'test/context.c', dependencies: test_dep),
+ env: test_env,
+ )
+endif
test(
'rules-file',
executable('test-rules-file', 'test/rules-file.c', dependencies: test_dep),
@@ -427,9 +430,11 @@ executable('fuzz-compose', 'fuzz/compose/target.c', dependencies: test_dep)
# Demo programs.
-executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep)
-executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep)
-executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep)
+if cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE')
+ executable('rmlvo-to-kccgst', 'test/rmlvo-to-kccgst.c', dependencies: test_dep)
+ executable('rmlvo-to-keymap', 'test/rmlvo-to-keymap.c', dependencies: test_dep)
+ executable('print-compiled-keymap', 'test/print-compiled-keymap.c', dependencies: test_dep)
+endif
if cc.has_header('linux/input.h')
executable('interactive-evdev', 'test/interactive-evdev.c', dependencies: test_dep)
endif