summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddOCaml.cmake
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2015-01-13 09:47:59 +0000
committerPeter Zotov <whitequark@whitequark.org>2015-01-13 09:47:59 +0000
commit1f00ac9368e6473b3215ec7bd660c92dd0e2b76e (patch)
tree65f831b27e97cb615c21d32c90ff578cc2f85892 /llvm/cmake/modules/AddOCaml.cmake
parent1ba46c661c7a9361237ed007715dfac46ccad7d2 (diff)
downloadbcm5719-llvm-1f00ac9368e6473b3215ec7bd660c92dd0e2b76e.tar.gz
bcm5719-llvm-1f00ac9368e6473b3215ec7bd660c92dd0e2b76e.zip
[OCaml] Use $CAMLORIGIN, an rpath-$ORIGIN-like mechanism in OCaml.
As a result, installations of LLVM in non-standard locations will not require passing custom -ccopt -L flags when building the binary, nor absolute paths would be embedded in the cma/cmxa files. Additionally, the executables will not require changes to LD_LIBRARY_PATH, although CAML_LD_LIBRARY_PATH still has to be set for ocamlc without -custom. See http://caml.inria.fr/mantis/view.php?id=6642. Note that the patch is approved, but not merged yet. It will be released in 4.03 and likely 4.02. llvm-svn: 225778
Diffstat (limited to 'llvm/cmake/modules/AddOCaml.cmake')
-rw-r--r--llvm/cmake/modules/AddOCaml.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake
index 4473a7dcf17..c58ac9cb734 100644
--- a/llvm/cmake/modules/AddOCaml.cmake
+++ b/llvm/cmake/modules/AddOCaml.cmake
@@ -53,6 +53,8 @@ function(add_ocaml_library name)
endif()
set(ocaml_flags "-lstdc++" "-ldopt" "-L${LLVM_LIBRARY_DIR}"
+ "-ccopt" "-L\\$CAMLORIGIN/.."
+ "-ccopt" "-Wl,-rpath,\\$CAMLORIGIN/.."
${ocaml_pkgs})
foreach( ocaml_dep ${ARG_OCAMLDEP} )
OpenPOWER on IntegriCloud