https://github.com/aherrmann/demo-cabal-header-forwarding
Demonstration of how Cabal forwards header files and include directories between packages
https://github.com/aherrmann/demo-cabal-header-forwarding
Last synced: about 1 month ago
JSON representation
Demonstration of how Cabal forwards header files and include directories between packages
- Host: GitHub
- URL: https://github.com/aherrmann/demo-cabal-header-forwarding
- Owner: aherrmann
- Created: 2018-12-21T10:33:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-21T11:04:46.000Z (over 7 years ago)
- Last Synced: 2025-03-02T22:18:28.535Z (over 1 year ago)
- Language: Haskell
- Size: 2.93 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo of Header forwarding in Cabal
This repository contains two Cabal projects `proj-a` and `proj-b`.
`proj-a` contains a header file `lib/include/header.h` and defines a library
and an executable target. The library target defines `include-dirs:
lib/include` so that the header can be included as `header.h`. The executable
target depends on the library target and includes the header file as
`header.h`.
`proj-b` contains an executable target that depends on the `proj-a` library and
includes `proj-a`'s header file as `header.h`.
All targets compile successfully with Cabal.
```
$ cabal new-build proj-a:lib:proj-a
$ cabal new-build proj-a:exe:proj-a
$ cabal new-build proj-b:exe:proj-b
```
This means that Cabal forwards the header file and the `include-dirs` defined
in `proj-a:lib` to both `proj-a:exe:proj-a` and to `proj-b:exe:proj-b`.