# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

# posix_memalign
legacysupport.newest_darwin_requires_legacy 9

github.setup        fraunhoferhhi vvenc 1.14.0 v
revision            0
categories          multimedia
license             BSD
maintainers         nomaintainer
description         VVenC, the Fraunhofer Versatile Video Encoder
long_description    {*}${description}
checksums           rmd160  7c91f4130d440d1e6f6c2c8b2a311e0c72f236e9 \
                    sha256  dd43d061d59dbc0d9b9ae5b99cb40672877dd811646228938f065798939ee174 \
                    size    2352859
github.tarball_from archive

cmake.build_type    Release
cmake.generator     Ninja

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON \
                    -DVVENC_ENABLE_INSTALL=ON \
                    -DVVENC_ENABLE_LINK_TIME_OPT=ON \
                    -DVVENC_ENABLE_UNSTABLE_API=OFF \
                    -DVVENC_ENABLE_WERROR=ON \
                    -DVVENC_ENABLE_X86_SIMD=OFF \
                    -DVVENC_USE_ADDRESS_SANITIZER=OFF

platform i386 {
    configure.args-delete \
                    -DVVENC_ENABLE_X86_SIMD=OFF
}

compiler.cxx_standard   2014

# CommonLib/UnitTools.cpp:1618:11: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
if {[string match *gcc* ${configure.compiler}]} {
    configure.cxxflags-append \
                    -Wno-error=memset-elt-size
}
