Skip to content
meson.build 1.11 KiB
Newer Older
Yuanle Song's avatar
Yuanle Song committed
# -*- mode: conf -*-
project('zero-pinyin-service', ['c', 'cpp'],
  version: '0.1.0',
  license: 'GPL',
  default_options: [
    'warning_level=2',
    'werror=true',
    'buildtype=release',
    'strip=true',
    'b_ndebug=if-release'])
# to create a debug build
# meson setup --buildtype debugoptimized build/

add_project_arguments(
  '-Wno-unused-parameter',
  '-Wno-missing-field-initializers',
  language: ['c', 'cpp'])
add_project_arguments(
  '-std=c11',
  language: 'c')
add_project_arguments(
  '-std=c++11',
  '-DHAVE_LIBUUID',
  language: 'cpp')

if get_option('buildtype').startswith('release')
  add_project_arguments(
    '-DG_DISABLE_ASSERT',
    '-DG_DISABLE_CHECKS',
    language: ['c', 'cpp'])
endif

glib = dependency('glib-2.0')
gio = dependency('gio-unix-2.0')
uuid = dependency('uuid')
shared_dep = [glib, gio, uuid]

src = ['../PinyinParser.cc', 'parse-pinyin.cpp', 'zero-pinyin-service.cc', 'main.c']
executable('main', src, dependencies: shared_dep)

test('zero-pinyin-service',
  executable('parse-pinyin',
    ['../PinyinParser.cc', 'parse-pinyin.cpp', 'parse-pinyin-test.cpp'],
    dependencies: shared_dep))