mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Support for environment variables
Change-Id: Ie52580703d3db36e3993d9e91cbbeb1fbb8cc1ae Signed-off-by: Koska <andrzej.koska@intel.com> Related-To: NEO-3239 Current order of reading debug variables: - igdrcl.config file - registry (under Windows) - Environment variables
This commit is contained in:
@@ -65,6 +65,11 @@ int32_t RegistryReader::getSetting(const char *settingName, int32_t defaultValue
|
||||
&size);
|
||||
RegCloseKey(Key);
|
||||
value = ERROR_SUCCESS == success ? value : defaultValue;
|
||||
} else { // Check environment variables
|
||||
char *envValue = getenv(settingName);
|
||||
if (envValue) {
|
||||
value = atoi(envValue);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -118,6 +123,11 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||
}
|
||||
|
||||
RegCloseKey(Key);
|
||||
} else { // Check environment variables
|
||||
char *envValue = getenv(settingName);
|
||||
if (envValue) {
|
||||
keyValue.assign(envValue);
|
||||
}
|
||||
}
|
||||
return keyValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user