-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for foreign_archive of cxx files
- Loading branch information
Showing
7 changed files
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(executable | ||
(name main) | ||
(modes byte) | ||
(libraries hello_world)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/foreign_cxx_library.t/dune-project
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 @@ | ||
(lang dune 2.9) |
9 changes: 9 additions & 0 deletions
9
test/blackbox-tests/test-cases/foreign_cxx_library.t/lib/dune
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,9 @@ | ||
(library | ||
(name hello_world) | ||
(foreign_archives hello_world) | ||
(c_library_flags -lstdc++)) | ||
|
||
(foreign_library | ||
(archive_name hello_world) | ||
(language cxx) | ||
(names hello_world)) |
8 changes: 8 additions & 0 deletions
8
test/blackbox-tests/test-cases/foreign_cxx_library.t/lib/hello_world.cpp
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,8 @@ | ||
#include <iostream> | ||
|
||
extern "C" void hello_world (); | ||
|
||
void hello_world () | ||
{ | ||
std::cout << "Hello World!"; | ||
} |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/foreign_cxx_library.t/lib/hello_world.ml
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 @@ | ||
external hello_world : unit -> unit = "hello_world" |
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 @@ | ||
Hello_world.hello_world ();; |
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,2 @@ | ||
Building a cxx library should run ocamlmklib with "-lstdc++". | ||
$ dune build --verbose 2>&1 | grep -e "ocamlmklib" | grep -qe "-lstdc++" |