diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-11-11 10:28:49 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-11-11 11:19:21 +0530 |
commit | ba316a0dff6e215394c0b2b4de2a46c56af6904c (patch) | |
tree | ee85d53708b467095156de7dc43e78ea2853f2ab | |
parent | aa5afba00b4c2b76093f45dd4c4c284142ac2b05 (diff) | |
download | meson-ba316a0dff6e215394c0b2b4de2a46c56af6904c.zip meson-ba316a0dff6e215394c0b2b4de2a46c56af6904c.tar.gz meson-ba316a0dff6e215394c0b2b4de2a46c56af6904c.tar.bz2 |
common/37 has header: Add a test for prefixes
-rw-r--r-- | test cases/common/37 has header/meson.build | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test cases/common/37 has header/meson.build b/test cases/common/37 has header/meson.build index ce6e71a..4f9b94f 100644 --- a/test cases/common/37 has header/meson.build +++ b/test cases/common/37 has header/meson.build @@ -1,10 +1,28 @@ project('has header', 'c', 'cpp') foreach comp : [meson.get_compiler('c'), meson.get_compiler('cpp')] - if comp.has_header('stdio.h') == false + if not comp.has_header('stdio.h') error('Stdio missing.') endif + # stdio.h doesn't actually need stdlib.h, but I don't know any headers on + # UNIX/Linux that need other headers defined beforehand + if not comp.has_header('stdio.h', prefix : '#include <stdlib.h>') + error('Stdio missing.') + endif + + # XInput.h needs windows.h included beforehand. We only do this check on MSVC + # because MinGW often defines its own wrappers that pre-include windows.h + if comp.get_id() == 'msvc' + if not comp.has_header('XInput.h', prefix : '#include <windows.h>') + error('XInput.h is missing on Windows') + endif + if comp.has_header('XInput.h') + error('XInput.h needs windows.h') + endif + endif + + if comp.has_header('ouagadougou.h') error('Found non-existant header.') endif |