From fb0a4a5d6c5fa0f7dcb2b418a2d0672abcbed1aa Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 9 Nov 2022 14:23:41 -0500 Subject: [PATCH] util: Define WITH_XMLCONFIG from Meson This will allow us to disable runtime xmlconfig even outside of Windows/Android. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Jesse Natalie Reviewed-by: Eric Engestrom Reviewed-by: Emma Anholt Part-of: --- src/util/meson.build | 6 +++++- src/util/xmlconfig.h | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/util/meson.build b/src/util/meson.build index 359475b6fe0dc..43e5e39efde72 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -288,7 +288,10 @@ idep_mesautil = declare_dependency( xmlconfig_deps = [] if not (with_platform_android or with_platform_windows) + c_xmlconfig_arg = '-DWITH_XMLCONFIG=1' xmlconfig_deps += dep_expat +else + c_xmlconfig_arg = '-DWITH_XMLCONFIG=0' endif xmlconfig_deps += dep_regex @@ -299,6 +302,7 @@ _libxmlconfig = static_library( dependencies : [idep_mesautil, dep_m, xmlconfig_deps], c_args : [ c_msvc_compat_args, + c_xmlconfig_arg, '-DSYSCONFDIR="@0@"'.format( join_paths(get_option('prefix'), get_option('sysconfdir')) ), @@ -328,7 +332,7 @@ if with_tests include_directories : [inc_include, inc_src], dependencies : [idep_mesautil, idep_xmlconfig, idep_gtest], override_options : ['cpp_std=c++2a'], - cpp_args: ['-Wno-write-strings'] + cpp_args: ['-Wno-write-strings', c_xmlconfig_arg] ), suite : ['util'], env: ['HOME=' + join_paths(meson.current_source_dir(), diff --git a/src/util/xmlconfig.h b/src/util/xmlconfig.h index 1b2daf857f535..dc219c9f89a0e 100644 --- a/src/util/xmlconfig.h +++ b/src/util/xmlconfig.h @@ -39,12 +39,6 @@ extern "C" { #endif -#if defined(ANDROID) || defined(_WIN32) -#define WITH_XMLCONFIG 0 -#else -#define WITH_XMLCONFIG 1 -#endif - #define STRING_CONF_MAXLEN 1024 /** \brief Option data types */