Closed
Description
install-includes
field is only processed for the library target. And it doesn't work for foreign-library
:
Minimal example:
foreign.cabal:
-- Initial foreign.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: foreign
version: 0.1.0.0
synopsis: An example of the foreign library.
description: Foreign library example, this project is done as
a simple test of the foreign libraries inclusion.
license: BSD3
license-file: LICENSE
author: Alexander Vershilov
maintainer: [email protected]
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=2.0
-- uncomment to fix an issue:
--library
-- build-depends: base >=4.9 && <4.10
-- hs-source-dirs: src
-- other-modules: Lib
-- install-includes: Lib_stub.h
-- default-language: Haskell2010
foreign-library mylib
type: native-shared
lib-version-info: 6:3:2
build-depends: base >=4.9 && <4.10
hs-source-dirs: src
other-modules: Lib
install-includes: Lib_stub.h
other-extensions: ForeignFunctionInterface
default-language: Haskell2010
src/Lib.hs
{-# LANGUAGE ForeignFunctionInterface #-}
module Lib
( fac1
) where
foreign export ccall fac1 :: Int -> Int
fac1 :: Int -> Int
fac1 n = product [1..n]
Relevant call in codebase:
cabal/Cabal/Distribution/Simple/Install.hs
Line 173 in 6814d87