# This file generated automatically:
# https://github.com/ruslo/sugar/wiki/Cross-platform-warning-suppression

# Copyright (c) 2014, Ruslan Baratov
# All rights reserved.

include(sugar_add_this_to_sourcelist)
sugar_add_this_to_sourcelist()

include(sugar_expected_number_of_arguments)

function(sugar_generate_warning_xcode_attr_by_name warn_flag warn_name)
  sugar_expected_number_of_arguments(${ARGC} 2)

  if(NOT XCODE_VERSION)
    set(${warn_flag} "" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "bool-conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "c++11-extensions" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_CXX0X_EXTENSIONS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "constant-conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "conversion-loss" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "deprecated-declarations" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "deprecated-objc-isa-usage" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_DIRECT_OBJC_ISA_USAGE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "documentation" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_DOCUMENTATION_COMMENTS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "empty-body" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "enum-conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "exit-time-destructors" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN__EXIT_TIME_DESTRUCTORS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "format" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_TYPECHECK_CALLS_TO_PRINTF" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "four-char-constants" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_FOUR_CHARACTER_CONSTANTS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "ill-formed-comma-expr" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "int-conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "invalid-offsetof" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "missing-braces" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "missing-field-initializers" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "missing-prototypes" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_PROTOTYPES" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "newline-eof" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "non-virtual-dtor" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_NON_VIRTUAL_DESTRUCTOR" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "overloaded-virtual" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "parentheses" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_MISSING_PARENTHESES" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "pointer-sign" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_POINTER_SIGNEDNESS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "return-type" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "shadow" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_SHADOW" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "shorten-64-to-32" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "sign-compare" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "sign-conversion" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_IMPLICIT_SIGN_CONVERSION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "signed-unsigned-compare" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "switch" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_CHECK_SWITCH_STATEMENTS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "uninitialized" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unknown-pragmas" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNKNOWN_PRAGMAS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unused-function" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unused-label" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_LABEL" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unused-parameter" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unused-value" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "unused-variable" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "arc-bridge-casts-disallowed-in-nonarc" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN__ARC_BRIDGE_CAST_NONARC" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "arc-repeated-use-of-weak" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "deprecated-implementations" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "duplicate-method-match" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN__DUPLICATE_METHOD_MATCH" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "explicit-ownership-type" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "implicit-atomic-properties" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "implicit-retain-self" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "objc-missing-property-synthesis" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "objc-root-class" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_ROOT_CLASS" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "protocol" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "receiver-is-weak" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_CLANG_WARN_OBJC_RECEIVER_WEAK" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "selector" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "strict-selector-match" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_STRICT_SELECTOR_MATCH" PARENT_SCOPE)
    return()
  endif()

  string(COMPARE EQUAL "${warn_name}" "undeclared-selector" hit)
  if(hit)
    set(${warn_flag} "XCODE_ATTRIBUTE_GCC_WARN_UNDECLARED_SELECTOR" PARENT_SCOPE)
    return()
  endif()

  set(${warn_flag} "" PARENT_SCOPE)
endfunction()
