Commit 8e75b8d0 authored by Maximilien Colange's avatar Maximilien Colange

Properly catch an exception if an environment variable is not defined.

parent c8045f6d
......@@ -13,8 +13,15 @@ let cxx = "g++"
* -xc++ to be sure to compile .c files as c++
* -fPIC to ensure position-independent code
let cxx_flags = ["-xc++"; "-fPIC"; Sys.getenv "CXX_FLAGS"]
let cxx_flags =
let env_cxx =
try Some (Sys.getenv "CXX_FLAGS")
with | Not_found -> None
match env_cxx with
| None -> ["-xc++"; "-fPIC"]
| Some x -> ["-xc++"; "-fPIC"; x]
(* a helper function *)
(* prefix every c++ flags with -ccopt *)
let ocaml_cxx_flags = fun flags ->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment