Created
May 22, 2019 16:23
-
-
Save ManasJayanth/a4f71190696ee093047fca35f7d565c1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let libpaths_str = Sys.getenv "libpath" in | |
let libpaths = Str.split (Str.regexp ";") libpaths_str in | |
let libpaths = libpaths @ [ | |
"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.17134.0/um/x64"; | |
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/lib/x64"; | |
"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.17134.0/ucrt/x64"; | |
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/lib/onecore/x64" | |
] in | |
let resolved_paths = List.map (fun base -> let as_is = Filename.concat base fn in | |
let with_lib = Filename.concat base (fn ^ ".lib") in | |
if Sys.file_exists as_is then | |
as_is | |
else if Sys.file_exists with_lib then | |
with_lib | |
else | |
fn | |
) libpaths |> List.filter (fun x -> x != fn) in | |
let fn = if (resolved_paths |> List.length) > 0 then | |
List.hd resolved_paths | |
else begin | |
print_endline (";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; No luck with " ^ fn) ; | |
fn | |
end | |
in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment