Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Add ALWAYS_INSTALL_HEADERS option #458

Closed
wants to merge 1 commit into from

Conversation

squeek502
Copy link
Member

Closes #457

@teto let me know if this is the sort of thing you had in mind.

@doronbehar
Copy link
Contributor

I'm the original person who wanted to update our luv on NixOS, (see NixOS/nixpkgs#80528).

Currently, without the patch and with BUILD_MODULE=OFF, we get the tree:

qvfnhmpb22wyl5zzxynin07lcxn1qy2x-luv-1.34.1-1/
├── include
│   └── luv
│       ├── lhandle.h
│       ├── lreq.h
│       ├── luv.h
│       └── util.h
├── lib
│   ├── libluv.so -> libluv.so.1
│   ├── libluv.so.1 -> libluv.so.1.34.1
│   ├── libluv.so.1.34.1
│   └── pkgconfig
│       └── libluv.pc
└── nix-support
    └── propagated-build-inputs

5 directories, 9 files

With the patch and with BUILD_MODULE=ON and ALWAYS_INSTALL_HEADERS=ON, we get the tree:

/nix/store/mnv468b533aacm6ji3ywfzlfbg5nr6yc-luv-1.34.1-1
├── include
│   └── luv
│       ├── lhandle.h
│       ├── lreq.h
│       ├── luv.h
│       └── util.h
├── lib
│   └── lua
│       └── 5.1
│           └── luv.so
└── nix-support
    └── propagated-build-inputs

6 directories, 6 files

But with this ^ tree, Neovim (e.g) fails to build because it can't find e.g the pkg-config files as found within the 1st tree.

What's so frustrating about the current behavior is that building the Lua module (that ends up in $prefix/lib/lua/5.1/) disables the installation of (almost I think) anything else.

Ideally, I'd like to see a fix as follows:

  • Make BUILD_MODULE=ON install the module but not disable installation of anything else!
  • Without any new flag introduced, if BUILD_SHARED_LIBS=ON, the headers, the pkg-config and whatever else that ended up in lib/ in the 1st tree will get installed as well.

@squeek502
Copy link
Member Author

@doronbehar right now BUILD_MODULE and BUILD_SHARED_LIBS are expected to be mutually exclusive (if one is on, the other is expected to be off). Are you wanting to be able to build both at once (and install both at once)?

@doronbehar
Copy link
Contributor

Correct.

@squeek502 squeek502 closed this Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make it possible to install both headers and library
3 participants