Files
yggm/meson.build

60 lines
1.3 KiB
Meson
Raw Permalink Normal View History

2025-08-21 13:05:05 +05:00
project(
'yggm',
['cpp', 'cuda'],
2025-08-21 03:44:21 +05:00
version: '20.08.2025',
2025-08-21 13:05:05 +05:00
default_options: ['cpp_std=c++20'],
2025-08-21 03:44:21 +05:00
)
2025-08-21 13:05:05 +05:00
cpp = meson.get_compiler('cpp')
cuda = meson.get_compiler('cuda')
2025-08-21 03:44:21 +05:00
common_cpp_flags = [
'-march=native',
2025-08-21 13:05:05 +05:00
'-ffast-math',
2025-08-21 03:44:21 +05:00
'-pipe',
2025-08-21 13:05:05 +05:00
'-funroll-loops',
2025-08-21 03:44:21 +05:00
'-Wpedantic',
'-Wconversion',
'-Wuninitialized',
'-Wsign-conversion',
2025-08-21 13:05:05 +05:00
'-masm=intel',
'-I../libs/',
2025-08-21 03:44:21 +05:00
]
common_cuda_flags = [
'-rdc=true',
2025-09-03 22:00:46 +05:00
'-Xptxas', '-O3',
2025-08-21 03:44:21 +05:00
'-use_fast_math',
'-ftz=true',
'-prec-div=false',
'-prec-sqrt=false',
'-gencode', 'arch=compute_75,code=sm_75',
'-Wno-deprecated-gpu-targets',
'--expt-relaxed-constexpr',
'-I../libs/',
]
add_project_arguments(common_cpp_flags, language: 'cpp')
add_project_arguments(common_cuda_flags, language: 'cuda')
if get_option('buildtype') == 'release'
2025-09-03 22:00:46 +05:00
add_project_arguments(['-DRELEASE'], language: ['cpp', 'cuda'])
2025-08-21 03:44:21 +05:00
elif get_option('buildtype') == 'debug'
2025-09-03 22:00:46 +05:00
add_project_arguments(['-DDEBUG'], language: ['cpp', 'cuda'])
2025-08-21 03:44:21 +05:00
endif
2025-08-21 13:05:05 +05:00
cpp_sources = ['sources/main.cpp'] + files(run_command('find', 'libs', '-name','*.h').stdout().split())
2025-08-21 03:44:21 +05:00
cuda_sources = ['sources/main.cu'] + files(run_command('find', 'libs', '-name', '*.cu').stdout().split())
2025-08-21 13:05:05 +05:00
executable(
'yggmcu',
2025-08-21 03:44:21 +05:00
sources: cuda_sources,
2025-09-03 22:00:46 +05:00
link_args: ['-lcudart', '-L/usr/local/cuda/lib64'],
2025-08-21 03:44:21 +05:00
)
2025-08-21 13:05:05 +05:00
executable(
'yggmc',
2025-08-21 03:44:21 +05:00
sources: cpp_sources,
2025-08-21 13:05:05 +05:00
dependencies: dependency('libsodium'),
2025-09-03 22:00:46 +05:00
)