Commit 3a864acf authored by Lennart Huth's avatar Lennart Huth Committed by Simon Spannagel
Browse files

only use cpuid.h functionality for macos with x86 processors

(cherry picked from commit 77d2f0d9)
parent d45b1054
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -9,7 +9,10 @@
 */

#include <atomic>
#if defined(__linux__) || (defined(__APPLE__) && !defined(__arm64__))
#include <cpuid.h>
#endif

#include <csignal>
#include <cstdlib>
#include <fstream>
@@ -126,6 +129,8 @@ int main(int argc, const char* argv[]) {
                      << G4VERSION_NUMBER % 10 << std::endl;
#endif

            // The new apple m silicon does not include cpuid
#if defined(__linux__) || (defined(__APPLE__) && !defined(__arm64__))
            std::array<char, 0x40> cpu_string;
            std::array<unsigned int, 4> cpu_info = {0, 0, 0, 0};
            __cpuid(0x80000000, cpu_info[0], cpu_info[1], cpu_info[2], cpu_info[3]);
@@ -145,6 +150,8 @@ int main(int argc, const char* argv[]) {
                      << std::endl;

            std::cout << std::endl;
#endif

            std::cout << "Copyright (c) 2017-2021 CERN and the Allpix Squared authors." << std::endl << std::endl;
            std::cout << "This software is distributed under the terms of the MIT License." << std::endl;
            std::cout << "In applying this license, CERN does not waive the privileges and immunities" << std::endl;