<commit_before>//--------------------------------------------------------------------------------------------------
/**
 * @file mkCommon.cpp
 *
 * Copyright (C) Sierra Wireless Inc.
 **/
//--------------------------------------------------------------------------------------------------

#include "mkTools.h"
#include "mkCommon.h"
#include <string.h>
#include <unistd.h>


namespace
{


//----------------------------------------------------------------------------------------------
/**
 * Get the path to the toolchain
 *
 * @return  The path to the toolchain, or an empty string if not specified.
 */
//----------------------------------------------------------------------------------------------
std::string GetToolChainDir
(
    const std::string& target          ///< The target device type (e.g., wp85)
)
//--------------------------------------------------------------------------------------------------
{
    auto allCapsPrefix = target + "_";
    auto toolChainDir = envVars::Get(allCapsPrefix + "TOOLCHAIN_DIR");   // WP
    if (toolChainDir.empty())
    {
        toolChainDir = envVars::Get(target + "_" + "TOOLCHAIN_DIR");
        if (toolChainDir.empty())
        {
            toolChainDir = envVars::Get("TOOLCHAIN_DIR");
        }
    }

    return toolChainDir;
}


//----------------------------------------------------------------------------------------------
/**
 * Get the path to a specific build tool.
 *
 * @return  The path to the tool, or an empty string if not specified.
 */
//----------------------------------------------------------------------------------------------
std::string GetToolPath
(
    const std::string& target,          ///< The target device type (e.g., wp85)
    const std::string& toolEnvVarName   ///< Base name of tool path env var (e.g., "CC")
)
//--------------------------------------------------------------------------------------------------
{
    // If the all-caps, target-specific tool path env var (e.g., "WP85_CC") is set, then use that.
    auto allCapsPrefix = target + "_";
    std::transform(allCapsPrefix.begin(), allCapsPrefix.end(), allCapsPrefix.begin(), ::toupper);<commit_msg>Properly convert target prefix to be all uppercase<commit_after>//--------------------------------------------------------------------------------------------------
/**
 * @file mkCommon.cpp
 *
 * Copyright (C) Sierra Wireless Inc.
 **/
//--------------------------------------------------------------------------------------------------

#include "mkTools.h"
#include "mkCommon.h"
#include <string.h>
#include <unistd.h>


namespace
{


//----------------------------------------------------------------------------------------------
/**
 * Get the path to the toolchain
 *
 * @return  The path to the toolchain, or an empty string if not specified.
 */
//----------------------------------------------------------------------------------------------
std::string GetToolChainDir
(
    const std::string& target          ///< The target device type (e.g., wp85)
)
//--------------------------------------------------------------------------------------------------
{
    auto allCapsPrefix = target + "_";
    std::transform(allCapsPrefix.begin(), allCapsPrefix.end(), allCapsPrefix.begin(), ::toupper);
    auto toolChainDir = envVars::Get(allCapsPrefix + "TOOLCHAIN_DIR");   // WP
    if (toolChainDir.empty())
    {
        toolChainDir = envVars::Get(target + "_" + "TOOLCHAIN_DIR");
        if (toolChainDir.empty())
        {
            toolChainDir = envVars::Get("TOOLCHAIN_DIR");
        }
    }

    return toolChainDir;
}


//----------------------------------------------------------------------------------------------
/**
 * Get the path to a specific build tool.
 *
 * @return  The path to the tool, or an empty string if not specified.
 */
//----------------------------------------------------------------------------------------------
std::string GetToolPath
(
    const std::string& target,          ///< The target device type (e.g., wp85)
    const std::string& toolEnvVarName   ///< Base name of tool path env var (e.g., "CC")
)
//--------------------------------------------------------------------------------------------------
{
    // If the all-caps, target-specific tool path env var (e.g., "WP85_CC") is set, then use that.
    auto allCapsPrefix = target + "_";
    std::transform(allCapsPrefix.begin(), allCapsPrefix.end(), allCapsPrefix.begin(), ::toupper);
{'fraction_non_alphanumeric': 0.4452193475815523, 'fraction_numerical': 0.0026996625421822273, 'mean_word_length': 0.9221789883268483, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1789679', 'n_tokens_mistral': 1009, 'n_tokens_neox': 992, 'n_words': 274}