-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test C program to check we can find the ocaml headers (#15)
Summary: Pull Request resolved: #15 Test Plan: https://github.com/shayne-fletcher/ocaml-scripts/actions/runs/8104512093 Reviewed By: bigfootjon Differential Revision: D54416893 Pulled By: shayne-fletcher fbshipit-source-id: f64e37bc0c554afed620e764c07cdeb0b876ef0a
- Loading branch information
1 parent
916bb9f
commit 35d76e6
Showing
4 changed files
with
37 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
# Example commands to generate 'third-party/ocaml/BUCK.test'. | ||
# ``` | ||
# mkdir -p third-party/ocaml | ||
# python3 ~/project/ocaml-scripts/dromedary.py -s "$(basename $OPAM_SWITCH_PREFIX)" -o ~/project/ocaml-scripts/third-party/ocaml/BUCK.test | ||
# ``` | ||
|
||
_SUPPORTED = not host_info().os.is_windows | ||
|
||
# buildifier: disable=no-effect | ||
cxx_binary( | ||
name = "version", | ||
srcs = ["version.c"], | ||
deps = ["root//third-party/ocaml:ocaml-dev"], | ||
) if _SUPPORTED else None | ||
|
||
# buildifier: disable=no-effect | ||
ocaml_binary( | ||
name = "test-unix", | ||
srcs = ["test_unix.ml"], | ||
name = "unix", | ||
srcs = ["unix.ml"], | ||
deps = ["root//third-party/ocaml:unix"], | ||
) if _SUPPORTED else None |
File renamed without changes.
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,13 @@ | ||
#include <stdio.h> | ||
|
||
#include <caml/version.h> | ||
|
||
char const* ocaml_version() { | ||
return OCAML_VERSION_STRING; | ||
} | ||
|
||
int main() { | ||
printf("The OCaml toolchain, version %s\n", ocaml_version()); | ||
|
||
return 0; | ||
} |