diff --git a/meson.build b/meson.build index e1af3c3b1..b06059b10 100644 --- a/meson.build +++ b/meson.build @@ -247,16 +247,6 @@ subdir('data') subdir('resources') if get_option('build_powder') - powder_args = [] - if uopt_lua != 'none' - powder_args += '-DLUACONSOLE' - endif - if not uopt_http - powder_args += '-DNOHTTP' - endif - if uopt_fftw - powder_args += '-DGRAVFFT' - endif powder_deps = [ threads_dep, zlib_dep, @@ -272,9 +262,9 @@ if get_option('build_powder') executable( 'powder', sources: powder_files, - include_directories: project_inc, - c_args: project_c_args + powder_args, - cpp_args: project_cpp_args + powder_args, + include_directories: [ project_inc, powder_inc ], + c_args: project_c_args, + cpp_args: project_cpp_args, cpp_pch: 'pch/pch_cpp.h', gui_app: true, link_args: project_link_args, @@ -283,7 +273,6 @@ if get_option('build_powder') endif if get_option('build_render') - render_args = [ '-DRENDERER', '-DNOHTTP' ] render_deps = [ threads_dep, zlib_dep, @@ -291,9 +280,9 @@ if get_option('build_render') executable( 'render', sources: render_files, - include_directories: project_inc, - c_args: project_c_args + render_args, - cpp_args: project_cpp_args + render_args, + include_directories: [ project_inc, render_inc ], + c_args: project_c_args, + cpp_args: project_cpp_args, cpp_pch: 'pch/pch_cpp.h', link_args: project_link_args, dependencies: render_deps, @@ -301,7 +290,6 @@ if get_option('build_render') endif if get_option('build_font') - font_args = [ '-DFONTEDITOR', '-DNOHTTP' ] font_deps = [ threads_dep, zlib_dep, @@ -314,9 +302,9 @@ if get_option('build_font') executable( 'font', sources: font_files, - include_directories: project_inc, - c_args: project_c_args + font_args, - cpp_args: project_cpp_args + font_args, + include_directories: [ project_inc, font_inc ], + c_args: project_c_args, + cpp_args: project_cpp_args, cpp_pch: 'pch/pch_cpp.h', gui_app: true, link_args: project_link_args, diff --git a/src/Config.template.h b/src/Config.template.h index 4dd50e648..52201650c 100644 --- a/src/Config.template.h +++ b/src/Config.template.h @@ -4,6 +4,12 @@ #mesondefine CURL_STATICLIB #mesondefine ZLIB_WINAPI +#mesondefine LUACONSOLE +#mesondefine NOHTTP +#mesondefine GRAVFFT +#mesondefine RENDERER +#mesondefine FONTEDITOR + #mesondefine BETA #mesondefine DEBUG #mesondefine IGNORE_UPDATES diff --git a/src/config/font/meson.build b/src/config/font/meson.build new file mode 100644 index 000000000..44c65f26d --- /dev/null +++ b/src/config/font/meson.build @@ -0,0 +1,12 @@ +font_conf_data = conf_data +font_conf_data.set('FONTEDITOR', true) +font_conf_data.set('RENDERER', false) +font_conf_data.set('LUACONSOLE', false) +font_conf_data.set('NOHTTP', true) +font_conf_data.set('GRAVFFT', false) +configure_file( + input: config_template, + output: 'Config.h', + configuration: font_conf_data +) +font_inc = include_directories('.') diff --git a/src/config/meson.build b/src/config/meson.build new file mode 100644 index 000000000..214e8915d --- /dev/null +++ b/src/config/meson.build @@ -0,0 +1,3 @@ +subdir('powder') +subdir('render') +subdir('font') diff --git a/src/config/powder/meson.build b/src/config/powder/meson.build new file mode 100644 index 000000000..cb03fac4e --- /dev/null +++ b/src/config/powder/meson.build @@ -0,0 +1,12 @@ +powder_conf_data = conf_data +powder_conf_data.set('FONTEDITOR', false) +powder_conf_data.set('RENDERER', false) +powder_conf_data.set('LUACONSOLE', uopt_lua != 'none') +powder_conf_data.set('NOHTTP', not uopt_http) +powder_conf_data.set('GRAVFFT', uopt_fftw) +configure_file( + input: config_template, + output: 'Config.h', + configuration: powder_conf_data +) +powder_inc = include_directories('.') diff --git a/src/config/render/meson.build b/src/config/render/meson.build new file mode 100644 index 000000000..aaa90b3be --- /dev/null +++ b/src/config/render/meson.build @@ -0,0 +1,12 @@ +render_conf_data = conf_data +render_conf_data.set('FONTEDITOR', false) +render_conf_data.set('RENDERER', true) +render_conf_data.set('LUACONSOLE', false) +render_conf_data.set('NOHTTP', true) +render_conf_data.set('GRAVFFT', false) +configure_file( + input: config_template, + output: 'Config.h', + configuration: render_conf_data +) +render_inc = include_directories('.') diff --git a/src/meson.build b/src/meson.build index 221958fc8..6671bbaa3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,8 +1,5 @@ -configure_file( - input: 'Config.template.h', - output: 'Config.h', - configuration: conf_data -) +config_template = files('Config.template.h') +subdir('config') powder_files = files( 'SDLCompat.cpp',