-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmeson.build
89 lines (76 loc) · 3.09 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
project( 'BVHTest', ['cpp', 'c'],
default_options : [
'cpp_std=c++17',
'warning_level=3',
'buildtype=debugoptimized',
'libdir=lib/BVHTest',
'includedir=include/BVHTest',
'b_colorout=always',
'b_ndebug=if-release'
],
version : '0.0.1',
license : 'Apache 2')
incDirsBase = ['external', 'external/fmt', 'external/cub', 'external/glm', 'external/spdlog/include', 'lib', '.', './lib']
incDirsRaw = []
foreach i : incDirsBase
incDirsRaw += meson.current_source_dir() + '/' + i
endforeach
incDirs = include_directories(incDirsBase)
assimp = dependency('assimp', required: true, version: '>=3.2.0')
glfw = dependency('glfw3', required: true, version: '>=3.1.0')
GL = dependency('GL', required: true, version: '>=3.3')
OpenMP = dependency('openmp', required: true)
dl = meson.get_compiler('c').find_library('dl', required : true)
threads = dependency('threads', required: true)
if get_option('buildtype') == 'debugoptimized'
add_global_arguments('-fno-omit-frame-pointer', language: 'cpp')
message('Enabling perf stuff')
endif
compiler = meson.get_compiler('cpp')
cfgData = configuration_data()
cfgData.set_quoted('BVHTEST_VERSION', meson.project_version())
cfgData.set_quoted('LOGGER_NAME', meson.project_name())
cfgData.set10('CUDA_FACE_CULLING', get_option('cudaFaceCulling'))
cfgData.set10('ENABLE_PROGRESS_BAR', get_option('enableProgressBar'))
baseDeps = [
threads,
OpenMP,
compiler.find_library('stdc++fs', required: true),
compiler.find_library('cudart', required: true, dirs: ['/usr/lib', '/usr/local/cuda/lib64', '/opt/cuda/lib64'])
]
if not compiler.has_header('filesystem') and not compiler.has_header('experimental/filesystem')
error('Unable to find C++17 filesystem')
endif
if not ['c++17', 'c++2a'].contains(get_option('cpp_std'))
error('At least c++17 required but ' + get_option('cpp_std') + ' provided')
endif
configure_file(
configuration: cfgData,
input: 'BVHTestCfg.hpp.in',
output: 'BVHTestCfg.hpp'
)
fullLibDirPath = get_option('prefix') + '/' + get_option('libdir')
enumGen = find_program(['external/enumGen/enumGen.py', 'enumGen.py', '/usr/bin/enumGen.py', '/bin/enumGen.py'], required : true)
nvcc = find_program(['nvcc', '/opt/cuda/bin/nvcc', '/usr/local/cuda/bin/nvcc'], required : true)
enumParser = generator(enumGen, output: '@[email protected]', arguments: ['-d', '@BUILD_DIR@', 'parse', '@INPUT@'])
nvccCompiler = generator(
nvcc,
output: '@[email protected]',
arguments: [
'@EXTRA_ARGS@',
'-gencode=arch=compute_50,code=sm_50',
'-gencode=arch=compute_52,code=sm_52',
'-gencode=arch=compute_60,code=sm_60',
'-gencode=arch=compute_61,code=sm_61',
'-gencode=arch=compute_70,code=sm_70',
'-gencode=arch=compute_70,code=compute_70',
'-O3', '-DNDEBUG', '-Xptxas', '-O3,-v', '-lineinfo', # '--maxrregcount=24',
#'-O0', '-G', '-g', '-Xptxas', '-O0,-v', # '--maxrregcount=24',
'-Xcudafe', '--diag_suppress=esa_on_defaulted_function_ignored', '--expt-relaxed-constexpr',
'-c', '@INPUT@', '-o', '@OUTPUT@',
])
# Build
subdir('external')
subdir('lib')
subdir('src')
#subdir('test')