aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-09-28 15:36:14 +0200
committerGaëtan Gilbert2018-09-28 15:36:14 +0200
commitd0122151acdbe15b88d144b730baf5b0febf3c70 (patch)
treee1649d77813269a8f27ab25530718a994ce0b25c /lib
parentf070a1f6eb99de1461d5a846a4f9ed47dafa79c6 (diff)
parent1a331405aa87c81eb51929557a7f3f10f8eabccf (diff)
Merge PR #8578: [dune] Allow to build CI after a Dune build.
Diffstat (limited to 'lib')
-rw-r--r--lib/system.ml4
-rw-r--r--lib/system.mli2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/system.ml b/lib/system.ml
index 902a4f2506..eec007dcab 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -302,10 +302,10 @@ let with_time ~batch f x =
raise e
(* We use argv.[0] as we don't want to resolve symlinks *)
-let get_toplevel_path top =
+let get_toplevel_path ?(byte=not Dynlink.is_native) top =
let open Filename in
let dir = if String.equal (basename Sys.argv.(0)) Sys.argv.(0)
then "" else dirname Sys.argv.(0) ^ dir_sep in
let exe = if Sys.(os_type = "Win32" || os_type = "Cygwin") then ".exe" else "" in
- let eff = if Dynlink.is_native then ".opt" else ".byte" in
+ let eff = if byte then ".byte" else ".opt" in
dir ^ top ^ eff ^ exe
diff --git a/lib/system.mli b/lib/system.mli
index a34280037c..f13fd30923 100644
--- a/lib/system.mli
+++ b/lib/system.mli
@@ -122,4 +122,4 @@ val with_time : batch:bool -> ('a -> 'b) -> 'a -> 'b
the right name you want you execution to fail rather than fall into
choosing some random binary from the system-wide installation of
Coq. *)
-val get_toplevel_path : string -> string
+val get_toplevel_path : ?byte:bool -> string -> string