void PBXProject::getBuildSettings(VariableCollection& settings) const { const PBXDocument& pbxDoc = getOwner(); settings.insert("PROJECT_NAME", pbxDoc.getName()); settings.insert("PROJECT_DIR", getProjectDir()); settings.insert("PROJECT_FILE_PATH", pbxDoc.getPath()); }
void getDefaultSettingValues(VariableCollection& vc, ProductMask mask) { for (unsigned i = 0; i < sizeof(_settings) / sizeof(SettingDesc); i++) { if (_settings[i].mask == mask) vc.insert(_settings[i].name, _settings[i].defaultValue); } }
void PBXNativeTarget::getBuildSettings(VariableCollection& settings) const { PBXTarget::getBuildSettings(settings); String productFileType = getProductFileType(); String productPath = getProductFileName(); String productNameFull = sb_basename(productPath); String productName = sb_fname(productNameFull); if (m_productType == "com.apple.product-type.library.static") { if (productFileType != "archive.ar") SBLog::warning() << "Unexpected product file type \"" << productFileType << "\" for \"" << getName() << "\" static lib target." << std::endl; settings.insert("EXECUTABLE_NAME", productNameFull); settings.insert("EXECUTABLE_PATH", productNameFull); } else if (m_productType == "com.apple.product-type.framework") { if (productFileType != "wrapper.framework") { SBLog::warning() << "Unexpected product file type \"" << productFileType << "\" for \"" << getName() << "\" framework target." << std::endl; } settings.insert("EXECUTABLE_NAME", productName); settings.insert("EXECUTABLE_PATH", joinPaths(productNameFull, productName)); } else if (m_productType == "com.apple.product-type.application") { // Fix up product name, when necessary if (productFileType == "compiled.mach-o.executable") productNameFull = productName + ".app"; else if (productFileType != "wrapper.application") SBLog::warning() << "Unexpected product file type \"" << productFileType << "\" for \"" << getName() << "\" app target." << std::endl; settings.insert("EXECUTABLE_NAME", productName); settings.insert("EXECUTABLE_FOLDER_PATH", productNameFull); } else if (m_productType == "com.apple.product-type.bundle") { if (productFileType != "wrapper.cfbundle") { SBLog::warning() << "Unexpected product file type \"" << productFileType << "\" for \"" << getName() << "\" bundle target." << std::endl; } settings.insert("EXECUTABLE_NAME", productName); settings.insert("EXECUTABLE_FOLDER_PATH", productNameFull); } settings.insert("PRODUCT_NAME", productName); settings.insert("FULL_PRODUCT_NAME", productNameFull); settings.insert("PRODUCT_TYPE", m_productType); }