Fix build without ASM.

This commit is contained in:
XMRig 2019-04-06 20:07:20 +07:00
parent db456a3e63
commit 466aad8543
2 changed files with 16 additions and 8 deletions

View file

@ -66,11 +66,14 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
setAesMode(reader.getValue("hw-aes")); setAesMode(reader.getValue("hw-aes"));
setAlgoVariant(reader.getInt("av")); setAlgoVariant(reader.getInt("av"));
setAssembly(reader.getValue("asm"));
setMaxCpuUsage(reader.getInt("max-cpu-usage", 100)); setMaxCpuUsage(reader.getInt("max-cpu-usage", 100));
setPriority(reader.getInt("cpu-priority", -1)); setPriority(reader.getInt("cpu-priority", -1));
setThreads(reader.getValue("threads")); setThreads(reader.getValue("threads"));
# ifndef XMRIG_NO_ASM
setAssembly(reader.getValue("asm"));
# endif
return finalize(); return finalize();
} }
@ -194,12 +197,6 @@ void xmrig::Config::setAlgoVariant(int av)
} }
void xmrig::Config::setAssembly(const rapidjson::Value &assembly)
{
m_assembly = Asm::parse(assembly);
}
void xmrig::Config::setMaxCpuUsage(int max) void xmrig::Config::setMaxCpuUsage(int max)
{ {
if (max > 0 && max <= 100) { if (max > 0 && max <= 100) {
@ -278,3 +275,11 @@ xmrig::AlgoVariant xmrig::Config::getAlgoVariantLite() const
return m_algoVariant; return m_algoVariant;
} }
#endif #endif
#ifndef XMRIG_NO_ASM
void xmrig::Config::setAssembly(const rapidjson::Value &assembly)
{
m_assembly = Asm::parse(assembly);
}
#endif

View file

@ -85,7 +85,6 @@ private:
bool finalize(); bool finalize();
void setAesMode(const rapidjson::Value &aesMode); void setAesMode(const rapidjson::Value &aesMode);
void setAlgoVariant(int av); void setAlgoVariant(int av);
void setAssembly(const rapidjson::Value &assembly);
void setMaxCpuUsage(int max); void setMaxCpuUsage(int max);
void setPriority(int priority); void setPriority(int priority);
void setThreads(const rapidjson::Value &threads); void setThreads(const rapidjson::Value &threads);
@ -95,6 +94,10 @@ private:
AlgoVariant getAlgoVariantLite() const; AlgoVariant getAlgoVariantLite() const;
# endif # endif
# ifndef XMRIG_NO_ASM
void setAssembly(const rapidjson::Value &assembly);
# endif
struct Threads struct Threads
{ {