forked from qt-creator/qt-creator
ProjectExplorer: Remove QTC_CPU override
QTC_CPU was broken in qmake and never worked there. Qbs never implemented the override properly, so neither did it work there. Use QSysInfo to retrieve information on CPU that Qt was built for and use that in the hostAbi. Change-Id: I298c15b2263c9eaf343a93037229de64e90c36ef Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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<quint8>(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;
|
||||
|
@@ -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
|
||||
|
@@ -15,8 +15,6 @@ Project {
|
||||
Depends { name: "TextEditor" }
|
||||
Depends { name: "app_version_header" }
|
||||
|
||||
cpp.defines: base.concat("QTC_CPU=X86Architecture")
|
||||
|
||||
Group {
|
||||
name: "General"
|
||||
files: [
|
||||
|
Reference in New Issue
Block a user