packages feed

cpu-features-0.1.0.0: cpu-features.cabal

cabal-version:      3.0
name:               cpu-features
version:            0.1.0.0
synopsis:           A library to detect CPU features
description:        This is a library to detect the features supported by the CPU running the Haskell program.
license:            BSD-3-Clause
license-file:       LICENSE
author:             ARATA Mizuki
maintainer:         minorinoki@gmail.com
copyright:          2025 ARATA Mizuki
category:           System
build-type:         Simple
extra-doc-files:    README.md CHANGELOG.md
-- extra-source-files:

common warnings
    ghc-options: -Wall -Wno-unticked-promoted-constructors

library
    import:           warnings
    exposed-modules:  System.CPUFeatures.X86
                      System.CPUFeatures.X86.Bool
                      System.CPUFeatures.X86.TypeBool
                      System.CPUFeatures.X86.Constraint
                      System.CPUFeatures.X86.Constraint.Unsafe
                      System.CPUFeatures.X86.Cpuid
                      System.CPUFeatures.Arm
                      System.CPUFeatures.Arm.Bool
                      System.CPUFeatures.Arm.TypeBool
                      System.CPUFeatures.Arm.Constraint
                      System.CPUFeatures.Arm.Constraint.Unsafe
                      System.CPUFeatures.RISCV
                      System.CPUFeatures.RISCV.Bool
                      System.CPUFeatures.RISCV.TypeBool
                      System.CPUFeatures.RISCV.Constraint
                      System.CPUFeatures.RISCV.Constraint.Unsafe
                      System.CPUFeatures.Util
    -- other-modules:
    -- other-extensions:
    if os(darwin)
      c-sources:      cbits/sysctl.c
    if os(linux) && (arch(aarch64) || arch(riscv64))
      other-modules:  Hwcap
    if arch(x86_64) || arch(i386)
      c-sources:      cbits/cpuid.c
    if os(linux) && arch(riscv64)
      other-modules:  Hwprobe
      c-sources:      cbits/hwprobe.c
    build-depends:    base >=4.16.0.0 && <4.22
    hs-source-dirs:   src
    default-language: GHC2021

executable cpu-features-demo
    import:           warnings
    main-is:          Main.hs
    -- other-modules:
    -- other-extensions:
    build-depends:
        base >=4.16.0.0 && <4.22,
        cpu-features

    hs-source-dirs:   demo
    default-language: GHC2021

test-suite cpu-features-test
    import:           warnings
    default-language: GHC2021
    -- other-modules:
    -- other-extensions:
    type:             exitcode-stdio-1.0
    hs-source-dirs:   test
    main-is:          Main.hs
    build-depends:
        base >=4.16.0.0 && <4.22,
        cpu-features