Files
linuxSmartie/meson.build
2026-07-21 20:57:39 +02:00

62 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', required : false)
if git.found()
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()
else
git_hash = 'unknown'
git_commits = '0'
endif
add_project_arguments(
'-DGIT_HASH="' + git_hash + '"',
'-DGIT_COMMITS="' + git_commits + '"',
language: 'c'
)
executable(
'linuxSmartie',
srcs,
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,
)