build(build): updated build system to be compatible with resource manager
The build system now passes compiler directives based on the mode being build. By default data is stored in the source root (and this is encoded into the compiled binary). However, if building in user mode then data is assumed to be at the meson install prefix data directory
This commit is contained in:
17
meson.build
17
meson.build
@@ -2,11 +2,28 @@ project('4DSSE', 'cpp', version: '0.0.1a', default_options: ['cpp_std=c++23'], m
|
||||
|
||||
# Add default visibility for all C++ targets
|
||||
add_project_arguments('-fvisibility=default', language: 'cpp')
|
||||
# Determine the mode
|
||||
mode = 1
|
||||
if get_option('user_mode')
|
||||
mode = 0
|
||||
endif
|
||||
|
||||
# Define DATA_DIR based on mode
|
||||
if mode == 1
|
||||
data_dir = meson.project_source_root() + '/assets/dynamic'
|
||||
else
|
||||
data_dir = get_option('prefix') + '/' + get_option('datadir') + '/4DSSE'
|
||||
endif
|
||||
|
||||
# Pass the DATA_DIR definition to the compiler
|
||||
add_project_arguments('-DDATA_DIR=' + data_dir, language : 'cpp')
|
||||
|
||||
# Build external dependencies first so that all the embedded resources are available to the other targets
|
||||
subdir('build-config')
|
||||
subdir('subprojects/PicoSHA2')
|
||||
|
||||
subdir('assets/static')
|
||||
|
||||
# Build the main project
|
||||
subdir('src')
|
||||
if get_option('build_tests')
|
||||
|
||||
Reference in New Issue
Block a user