diff --git a/meson_options.txt b/meson_options.txt index b9de6b83..e357e8d1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,3 +8,4 @@ option('with_xnvctrl', type : 'feature', value : 'enabled', description: 'Enable option('with_x11', type : 'feature', value : 'enabled') option('with_wayland', type : 'feature', value : 'disabled') option('with_dbus', type : 'feature', value : 'enabled') +option('with_dlsym', type : 'feature', value : 'disabled') diff --git a/src/meson.build b/src/meson.build index 4cd1981d..f00cf59d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -63,7 +63,9 @@ opengl_files = files( 'gl/inject_egl.cpp', ) -pre_args += '-DHOOK_DLSYM' +if get_option('with_dlsym').enabled() + pre_args += '-DHOOK_DLSYM' +endif if get_option('with_xnvctrl').enabled() diff --git a/src/overlay.cpp b/src/overlay.cpp index 298118ed..fbc8d641 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -817,7 +817,10 @@ void init_gpu_stats(uint32_t& vendorID, overlay_params& params) } void init_system_info(){ - unsetenv("LD_PRELOAD"); + const char* ld_preload = getenv("LD_PRELOAD"); + if (ld_preload) + unsetenv("LD_PRELOAD"); + ram = exec("cat /proc/meminfo | grep 'MemTotal' | awk '{print $2}'"); trim(ram); cpu = exec("cat /proc/cpuinfo | grep 'model name' | tail -n1 | sed 's/^.*: //' | sed 's/([^)]*)/()/g' | tr -d '(/)'"); @@ -833,6 +836,8 @@ void init_system_info(){ trim(driver); //driver = itox(device_data->properties.driverVersion); + if (ld_preload) + setenv("LD_PRELOAD", ld_preload, 1); #ifndef NDEBUG std::cout << "Ram:" << ram << "\n" << "Cpu:" << cpu << "\n"