You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are rather straightforward to support with command line flags or a myocamlbuild.ml plugin. It would be nice to have more robust support in the ocamlbuild tool itself though. For example, the sample plugin I've included only supports a single 'link.rpath' file. It would be nice to have the name of the file come from the matching executable target (foo.rpath -> foo.native).
Steps to reproduce
An example myocamlbuild.ml which:
Creates an 'rpath' tag and reads link path information from "link.rpath"
Creates a 'static' tag for fully statically linked executables
open Ocamlbuild_plugin
let rpaths = string_list_of_file "link.rpath"
let static_flags = S [A "-cclib"; A "-static"]
let () = dispatch begin function
| After_rules ->
List.iter (
fun path ->
let rpath_flags = S [A "-cclib"; A ("-Wl,-rpath," ^ path)] in
flag ["ocaml"; "link"; "program"; "rpath"] rpath_flags;
flag ["ocaml"; "link"; "library"; "rpath"] rpath_flags;
) rpaths;
flag ["ocaml"; "link"; "program"; "static"] static_flags;
| _ -> ()
end
The text was updated successfully, but these errors were encountered:
Original bug ID: 5963
Reporter: @hcarty
Status: resolved (set by @damiendoligez on 2017-03-01T16:10:22Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 4.00.1
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: thelema @hcarty
Bug description
These are rather straightforward to support with command line flags or a myocamlbuild.ml plugin. It would be nice to have more robust support in the ocamlbuild tool itself though. For example, the sample plugin I've included only supports a single 'link.rpath' file. It would be nice to have the name of the file come from the matching executable target (foo.rpath -> foo.native).
Steps to reproduce
An example myocamlbuild.ml which:
open Ocamlbuild_plugin
let rpaths = string_list_of_file "link.rpath"
let static_flags = S [A "-cclib"; A "-static"]
let () = dispatch begin function
| After_rules ->
List.iter (
fun path ->
let rpath_flags = S [A "-cclib"; A ("-Wl,-rpath," ^ path)] in
flag ["ocaml"; "link"; "program"; "rpath"] rpath_flags;
flag ["ocaml"; "link"; "library"; "rpath"] rpath_flags;
) rpaths;
flag ["ocaml"; "link"; "program"; "static"] static_flags;
| _ -> ()
end
The text was updated successfully, but these errors were encountered: