diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 90a27134a51..a12e531859c 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -50,6 +50,27 @@ namespace ProjectExplorer { // Helpers // -------------------------------------------------------------------------- +static Abi::Architecture architectureFromQt() +{ + const QString arch = QSysInfo::buildCpuArchitecture(); + if (arch.startsWith("arm")) + return Abi::ArmArchitecture; + if (arch.startsWith("x86") || arch == "i386") + return Abi::X86Architecture; + if (arch == "ia64") + return Abi::ItaniumArchitecture; + if (arch.startsWith("mips")) + return Abi::MipsArchitecture; + if (arch.startsWith("power")) + return Abi::PowerPCArchitecture; + if (arch.startsWith("sh")) // Not in Qt documentation! + return Abi::ShArchitecture; + if (arch.startsWith("avr")) // Not in Qt documentation! + return Abi::AvrArchitecture; + + return Abi::UnknownArchitecture; +} + static quint8 getUint8(const QByteArray &data, int pos) { return static_cast(data.at(pos)); @@ -838,7 +859,7 @@ Abi::OSFlavor Abi::flavorForMsvcVersion(int version) Abi Abi::hostAbi() { - Architecture arch = QTC_CPU; // define set by qmake + Architecture arch = architectureFromQt(); OS os = UnknownOS; OSFlavor subos = UnknownFlavor; BinaryFormat format = UnknownFormat; diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 979a3e865d8..faf97955e67 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -332,11 +332,4 @@ journald { RESOURCES += projectexplorer.qrc -# Some way to override the architecture used in Abi: -!isEmpty($$(QTC_CPU)) { - DEFINES += QTC_CPU=$$(QTC_CPU) -} else { - DEFINES += QTC_CPU=X86Architecture -} - DEFINES += PROJECTEXPLORER_LIBRARY diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 2b643f69a76..5bb71972047 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -15,8 +15,6 @@ Project { Depends { name: "TextEditor" } Depends { name: "app_version_header" } - cpp.defines: base.concat("QTC_CPU=X86Architecture") - Group { name: "General" files: [