forked from tycho/cpuid
-
Notifications
You must be signed in to change notification settings - Fork 4
/
meson.build
50 lines (38 loc) · 1.39 KB
/
meson.build
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
project('cpuid', 'c',
default_options: [
'buildtype=minsize',
'c_std=gnu99',
'b_lto=true',
]
)
compiler = meson.get_compiler('c')
perl = find_program('perl')
gen_build_h = custom_target('build.h',
output : ['build.h'],
command : [perl, meson.current_source_dir() + '/tools/build.pl', '@OUTPUT@'])
gen_license_h = custom_target('license.h',
input : ['LICENSE'],
output : ['license.h'],
command : [perl, meson.current_source_dir() + '/tools/license.pl', '@INPUT@', '@OUTPUT@'])
src = ['cache.c', 'clock.c', 'cpuid.c', 'feature.c', 'handlers.c', 'main.c', 'sanity.c', 'threads.c', 'util.c', 'version.c']
incdirs = [include_directories('.')]
dependencies = [
dependency('threads'),
]
if host_machine.system() != 'windows'
dependencies += compiler.find_library('m')
endif
if target_machine.system() == 'windows' or target_machine.system() == 'cygwin'
dependencies += compiler.find_library('winmm')
endif
if not compiler.has_header('getopt.h')
incdirs += include_directories('getopt')
src += 'getopt/getopt_long.c'
endif
executable('cpuid',
src,
gen_build_h,
gen_license_h,
include_directories : incdirs,
dependencies : dependencies)
# vim: set ts=4 sts=4 sw=4 et: