diff --git a/CMakeLists.txt b/CMakeLists.txt index 72770bb7..0aa54030 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,11 @@ if (host_cpu STREQUAL "x86_64") cpuid/x86.hpp ) else () - message (FATAL_ERROR "Unknown architecture ${host_cpu}") + message (WARNING "Unknown architecture ${host_cpu}. Defaulting to null implementation") + list (APPEND UTIL_FILES + cpuid/none.cpp + cpuid/none.hpp + ) endif () diff --git a/cpuid/none.cpp b/cpuid/none.cpp new file mode 100644 index 00000000..4a8273e0 --- /dev/null +++ b/cpuid/none.cpp @@ -0,0 +1,19 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 2019 Danny Robson + */ + +#include "none.hpp" + +#include + + +/////////////////////////////////////////////////////////////////////////////// +std::ostream& +cruft::cpu::operator<< (std::ostream &os, none const &) +{ + return os << "{ }"; +} diff --git a/cpuid/none.hpp b/cpuid/none.hpp new file mode 100644 index 00000000..d6001867 --- /dev/null +++ b/cpuid/none.hpp @@ -0,0 +1,17 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 2019 Danny Robson + */ + +#pragma once + +#include + +namespace cruft::cpu { + struct none { }; + + std::ostream& operator<< (std::ostream &os, none const &); +}; \ No newline at end of file