diff options
Diffstat (limited to 'share/qbs/imports/qbs/Probes/IarProbe.qbs')
-rw-r--r-- | share/qbs/imports/qbs/Probes/IarProbe.qbs | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/share/qbs/imports/qbs/Probes/IarProbe.qbs b/share/qbs/imports/qbs/Probes/IarProbe.qbs index 4ac05551c..d261e9065 100644 --- a/share/qbs/imports/qbs/Probes/IarProbe.qbs +++ b/share/qbs/imports/qbs/Probes/IarProbe.qbs @@ -65,42 +65,25 @@ PathProbe { compilerFilePath, tag); } - // FIXME: Do we need dump the default paths for both C - // and C++ languages? - var defaultPaths = IAR.dumpDefaultPaths( - compilerFilePath, languages[0]); - var macros = compilerDefinesByLanguage["c"] || compilerDefinesByLanguage["cpp"]; architecture = IAR.guessArchitecture(macros); endianness = IAR.guessEndianness(macros); - includePaths = defaultPaths.includePaths; - var version = parseInt(macros["__VER__"], 10); + // FIXME: Do we need dump the default paths for both C + // and C++ languages? + var defaultPaths = IAR.dumpDefaultPaths( + compilerFilePath, languages[0]); - if (architecture === "arm") { - versionMajor = parseInt(version / 1000000); - versionMinor = parseInt(version / 1000) % 1000; - versionPatch = parseInt(version) % 1000; - } else if (architecture === "mcs51") { - versionMajor = parseInt(version / 100); - versionMinor = parseInt(version % 100); - versionPatch = 0; - } else if (architecture === "avr") { - versionMajor = parseInt(version / 100); - versionMinor = parseInt(version % 100); - versionPatch = 0; - } else if (architecture === "stm8") { - versionMajor = parseInt(version / 100); - versionMinor = parseInt(version % 100); - versionPatch = 0; - } else if (architecture === "msp430") { - versionMajor = parseInt(version / 100); - versionMinor = parseInt(version % 100); - versionPatch = 0; - } + includePaths = defaultPaths.includePaths; - found = version && architecture && endianness; + var version = IAR.guessVersion(macros, architecture); + if (version) { + versionMajor = version.major; + versionMinor = version.minor; + versionPatch = version.patch; + found = version && architecture && endianness; + } } } |