meson.build
| 1 | project('orcsmasher', 'c', |
| 2 | version : '0.1', |
| 3 | default_options : ['warning_level=3', 'c_std=c99']) |
| 4 | |
| 5 | inc = include_directories('include') |
| 6 | |
| 7 | cc = meson.get_compiler('c') |
| 8 | static_build = get_option('default_library') == 'static' |
| 9 | |
| 10 | |
| 11 | CFLAGS = ['-Wno-type-limits'] |
| 12 | LDFLAGS = [] |
| 13 | |
| 14 | if get_option('buildtype') == 'debug' |
| 15 | CFLAGS += ['-Og', '-g', '-fsanitize=address'] |
| 16 | LDFLAGS += ['-lasan'] |
| 17 | endif |
| 18 | |
| 19 | if get_option('buildtype') == 'release' |
| 20 | CFLAGS += ['-O3', '-march=native', '-g'] |
| 21 | if static_build |
| 22 | LDFLAGS += ['-static'] |
| 23 | endif |
| 24 | endif |
| 25 | |
| 26 | |
| 27 | if static_build |
| 28 | LDFLAGS += ['-l:libgpm.a'] |
| 29 | endif |
| 30 | |
| 31 | srcprefix = 'src/' |
| 32 | srcraw = [ |
| 33 | 'algorithm.c', |
| 34 | 'loop.c', |
| 35 | 'main.c', |
| 36 | 'tui.c', |
| 37 | ] |
| 38 | src = [] |
| 39 | foreach s : srcraw |
| 40 | src += srcprefix + s |
| 41 | endforeach |
| 42 | |
| 43 | curses_dep = dependency('ncursesw', static: static_build) |
| 44 | panel_dep = dependency('panelw', static: static_build) |
| 45 | executable('orcsmasher', src, include_directories: inc, dependencies: [curses_dep, panel_dep], c_args: CFLAGS, link_args: LDFLAGS) |
| 46 | |
| 47 |