{% set name = "aws-c-common" %}
{% set version = "0.6.2" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://github.com/awslabs/{{ name }}/archive/v{{ version }}.tar.gz
  sha256: 1d83174b73b030aca802b220e45576822ef71dddc33041bf77d7847148e7c496
  patches:
    - 0001-Explicitly-remove-Werror.patch

build:
  number: 0
  run_exports:
    - {{ pin_subpackage("aws-c-common", max_pin="x.x.x") }}

requirements:
  build:
    - cmake !=3.19.0,!=3.19.1
    - {{ compiler('c') }}
    - ninja

test:
  commands:
    - test -f $PREFIX/lib/libaws-c-common${SHLIB_EXT}  # [unix]
    - test -f $PREFIX/include/aws/common/config.h  # [unix]
    - test -f $PREFIX/lib/cmake/AwsCFlags.cmake  # [unix]
    # Check for the non-existence of -Werror in the CFLAGS
    - '! grep Werror $PREFIX/lib/cmake/AwsCFlags.cmake'  # [unix]
    - if not exist %PREFIX%\\Library\\bin\\aws-c-common.dll exit 1  # [win]
    - if not exist %PREFIX%\\Library\\include\\aws\\common\\config.h exit 1  # [win]
    - if not exist %PREFIX%\\Library\\lib\\cmake\\AwsCFlags.cmake exit 1  # [win]

about:
  home: https://github.com/awslabs/aws-c-common
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  summary: Core c99 package for AWS SDK for C. Includes cross-platform primitives, configuration, data structures, and error handling.

extra:
  recipe-maintainers:
    - xhochy
