# -*- 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           github 1.0
PortGroup           cmake 1.0

github.setup        google highway 1.3.0
categories          devel
maintainers         {jmr @jmroot}
license             {Apache-2 BSD}

description         portable SIMD/vector intrinsics

long_description    Highway is a C++ library that provides portable \
                    SIMD/vector intrinsics.

github.tarball_from releases
checksums           rmd160 43d0afecb05ca9afab353e30f5e3294b0eb3db74 \
                    sha256 e8d696900b45f4123be8a9d6866f4e7b6831bf599f4b9c178964d968e6a58a69

cmake.out_of_source yes
configure.args-append \
                    -DBUILD_SHARED_LIBS=ON \
                    -DBUILD_TESTING=OFF

if {${os.platform} eq "darwin" && [vercmp ${macosx_deployment_target} < 10.12]} {
    configure.args-append   -DHWY_DISABLE_FUTEX=ON
}

compiler.cxx_standard   2011
# Compilation warning: "x86 Clang <= 6: define HWY_COMPILE_ONLY_SCALAR or upgrade."
# (Xcode Clang 10.0.1 ~= llvm.org Clang 7.0)
compiler.blacklist  {clang < 1001}

variant tests description {Enable building of test code} {
    depends_build-append    port:gtest
    configure.args-replace  -DBUILD_TESTING=OFF \
                            -DBUILD_TESTING=ON
    configure.args-append   -DHWY_SYSTEM_GTEST=ON
    test.run        yes
}
