forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Masayuki Takeda <mtakeda@oeconomia.jp> Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> Co-authored-by: Etienne Millon <me@emillon.org>
- Loading branch information
1 parent
72c5505
commit a9b7982
Showing
2 changed files
with
50 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.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,43 @@ | ||
mdx supports dependencies referencing shared libraries. | ||
|
||
See #10582. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.15) | ||
> (name dune_mdx_test) | ||
> (using mdx 0.4) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (name public_lib) | ||
> (foreign_archives test)) | ||
> | ||
> (rule | ||
> (deps test.c) | ||
> (targets libtest.a dlltest.so) | ||
> (action | ||
> (progn | ||
> (run gcc -c -fPIC test.c -o test.o) | ||
> (run gcc test.o -shared -o dlltest.so) | ||
> (run ar rcs libtest.a test.o)))) | ||
> | ||
> (mdx | ||
> (libraries public_lib)) | ||
> EOF | ||
|
||
$ cat > public_lib.mli << EOF | ||
> val foo : int -> int | ||
> EOF | ||
|
||
$ cat > public_lib.ml << EOF | ||
> let foo bar = bar + 1 | ||
> EOF | ||
|
||
$ cat > test.c << EOF | ||
> int add(int a, int b) { | ||
> return a + b; | ||
> } | ||
> EOF | ||
|
||
$ dune runtest |