summaryrefslogtreecommitdiff
path: root/tests/examplefiles/meson/meson.build
blob: 1d344bb824224965e03f6884e826a4e33963c976 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
project('pygments', 'c',
  version : '0.1',
  default_options : ['warning_level=3']
)
import('fs')
builder = build_machine
target = target_machine
host = host_machine

# This is a comment
cc = meson.get_compiler('c')
cc.compiles(
'''
/*This
''
is a multiline string

# with an embedded line that looks like a comment

and some other elements like

true false
0 1
project()
*/
#include <stdio.h>
int main(void) {
  printf("hello\n");
}
'''
)
exe = executable('pygments', 'pygments.c', install : true)
dep = cc.find_library('foo', disabler: true)

foreach x : [42, 0x55000, 0o6, exe]
  if not is_disabler(dep)
    library('lib', 'lib.c', include_directories: [], dependencies: dep)
  elif false
    both_libraries('lib', 'lib2.c')
  else
    message('failed')
    continue
  endif
  break
endforeach

test('basic', exe)
subdir('dir')
if not get_option('build-docs')
  summary({'docs': [false, '(disabled by config)']}, section: 'Configuration')
  subdir_done()
endif