user1002430
user1002430

Reputation:

How to reference local Cabal library from a local Cabal executable project?

I have the following folder structure:

~/scm/my-cabal-library
~/scm/my-cabal-executable

Each folder contains a Cabal sandbox and Cabal project. The first is a library and the second is an executable. I'd like for the executable to use the modules from my-cabal-library.

The Cabal documentation doesn't discuss how to do this.

How do I tell Cabal about the library so that it can import the modules in my executable project?

Upvotes: 2

Views: 208

Answers (1)

kqr
kqr

Reputation: 15028

You refer to the library simply as my-cabal-library in your Cabal file. You add it to your sandbox with cabal add-source ../my-cabal-library which will make Cabal aware of where it can get the dependency you created.

Upvotes: 4

Related Questions