-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This field works like install_c_headers except it allows full file names and allows to customize the destination paths Signed-off-by: Rudi Grinberg <[email protected]> <!-- ps-id: cf542cda-1684-4719-bffd-fdb6a8bc2d63 -->
- Loading branch information
Showing
5 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
test/blackbox-tests/test-cases/foreign-stubs/public-headers.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Headers with the same filename cannot be installed together: | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.8) | ||
> (package (name mypkg)) | ||
> EOF | ||
|
||
$ mkdir inc | ||
|
||
$ cat >dune <<EOF | ||
> (library | ||
> (public_name mypkg) | ||
> (public_headers foo.h (inc/foo.h as inc/foo.h))) | ||
> EOF | ||
|
||
$ touch foo.h inc/foo.h | ||
|
||
$ dune build mypkg.install && cat _build/default/mypkg.install | grep ".h" | ||
"_build/install/default/lib/mypkg/foo.h" | ||
"_build/install/default/lib/mypkg/inc/foo.h" {"inc/foo.h"} | ||
|
||
Now we try to use the installed headers: | ||
|
||
$ dune install --prefix _install mypkg | ||
$ export OCAMLPATH=$PWD/_install/lib:$OCAMLPATH | ||
|
||
$ mkdir subdir | ||
$ cd subdir | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.8) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (executable | ||
> (name bar) | ||
> (foreign_stubs | ||
> (language c) | ||
> (include_dirs (lib mypkg)) | ||
> (names foo))) | ||
> EOF | ||
$ touch bar.ml | ||
$ cat >foo.c <<EOF | ||
> #include <foo.h> | ||
> #include <inc/foo.h> | ||
> EOF | ||
$ dune build bar.exe |