58 lines
1.6 KiB
Meson
58 lines
1.6 KiB
Meson
project(
|
|
'linuxSmartie',
|
|
'c',
|
|
version: '1.0',
|
|
default_options : [
|
|
'prefix=/home/drath/.local',
|
|
'c_std=c23',
|
|
'warning_level=everything', # -> -Wall -Wextra -Wpedantic, also try =everything
|
|
'werror=true', # -> -Werror
|
|
'buildtype=release', # -> -O3, no debug
|
|
],
|
|
)
|
|
|
|
srcs = [
|
|
'src/aio.c',
|
|
'src/cpu.c',
|
|
'src/gpu.c',
|
|
'src/lcd.c',
|
|
'src/log.c',
|
|
'src/main.c',
|
|
'src/sys.c',
|
|
'src/utils.c'
|
|
]
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
git = find_program('git')
|
|
git_hash = run_command(git, 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
|
|
git_commits = run_command(git, 'rev-list', '--count', 'HEAD', check: false).stdout().strip()
|
|
|
|
version_h = vcs_tag(
|
|
input : 'include/version.h.in',
|
|
output : 'version.h',
|
|
command : ['git', 'describe', '--always', '--long', '--dirty'],
|
|
replace_string : '@VCS_TAG@',
|
|
fallback : 'unknown',
|
|
)
|
|
|
|
executable(
|
|
'linuxSmartie',
|
|
srcs + [version_h],
|
|
include_directories : include_directories('include'),
|
|
dependencies : [
|
|
dependency('libusb-1.0', required : true),
|
|
cc.find_library('m', required : true),
|
|
],
|
|
c_args : [
|
|
'-D_GNU_SOURCE',
|
|
'-D_POSIX_C_SOURCE=200809L',
|
|
'-Wno-c++-compat', # dont care about c++
|
|
'-Wno-format-truncation', # hates pretty_bytes/pretty_num
|
|
'-Wno-conversion', # just annoying
|
|
'-Wno-cast-align', # casting char array to gpu_metrics
|
|
'-Wno-padded', # mostly for gpu_metrics.h
|
|
'-Wno-bad-function-cast' # cpu power bug
|
|
],
|
|
install : true,
|
|
) |