summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddOCaml.cmake
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] [ocaml] Support linking against dylibMichal Gorny2019-10-111-14/+18
| | | | | | | | | Support linking OCaml modules against LLVM dylib when requested, rather than against static libs that might not be installed at all. Differential Revision: https://reviews.llvm.org/D68452 llvm-svn: 374556
* Move the srpm, ocaml_make_directory, llvm_vcsrevision_h, and llvm-headers ↵Aaron Ballman2017-11-041-0/+1
| | | | | | projects into the Misc folder on IDEs like Visual Studio rather than leave them in the root directory. NFC. llvm-svn: 317416
* [OCaml] Pass -D/-UNDEBUG through to ocamlcMichal Gorny2017-07-291-0/+5
| | | | | | | | | | Detect [/-][DU]NDEBUG in CMAKE_C_FLAGS* and pass them through to ocamlc. This is necessary because their value might affect visibility of dump functions in LLVM and ocamlc uses its own compiler and flags by default. Differential Revision: https://reviews.llvm.org/D35898 llvm-svn: 309483
* [OCaml] Install dynamic libraries in 'stubdirs' directoryMichal Gorny2017-07-291-1/+1
| | | | | | | | | | | | | | | | Install the OCaml dynamic libraries in the 'stubdirs' directory rather than the llvm subdirectory in order to fix running executables created by ocamlc. Otherwise, the executables fail to run being unable to locate the libraries (unless the LLVM directory is explicitly added to LD_LIBRARY_PATH). The staging directories are not altered since they work for our development setup anyway, and installing into two directories would unnecessarily make the code more complex. Differential Revision: https://reviews.llvm.org/D35995 llvm-svn: 309481
* Revert rL309320 - "[OCaml] Respect CMAKE_C_FLAGS for OCaml C files"Michal Gorny2017-07-281-1/+1
| | | | | | | This causes buildbot breakage for systems where OCaml files are built with a different compiler. llvm-svn: 309364
* [OCaml] Respect CMAKE_C_FLAGS for OCaml C filesMichal Gorny2017-07-271-1/+1
| | | | | | | | | | | | | | | Pass the values of CMAKE_C_FLAGS and CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} as -ccopt to ocamlc. This enforces the specific flags used for the LLVM build to be used for OCaml bindings as well, notably -O and -march flags. This also solves the issue of the user being unable to force specific flags for OCaml bindings builds. Gentoo needs this to enforce -DNDEBUG consistently between the LLVM build and the split OCaml bindings build. Differential Revision: https://reviews.llvm.org/D35898 llvm-svn: 309320
* [OCaml] Install .mli (interface) filesMichal Gorny2016-10-011-1/+2
| | | | | | | | | | | | | Install the OCaml interface .mli files. Those files were most likely omitted because they are input files for the compiled .cmi files. However, installing them is reasonable since -- unlike .cmi files -- they are human-readable. The issue was originally spotted by @jpdeplaix. Differential Revision: https://reviews.llvm.org/D25128 llvm-svn: 283028
* cmake: Install the OCaml libraries into a more correct pathMichal Gorny2016-09-301-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a OCAML_INSTALL_PATH variable that can be used to control the install path for OCaml libraries. The new variable defaults to ${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from the OCaml compiler. Install libraries into "llvm" subdirectory. This fixes two issues: 1. OCaml library directories differ between systems, and 'lib/ocaml' is incorrect e.g. on amd64 Gentoo where OCaml is installed in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml compiler using 'ocamlc -where' (which is already used to set OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages. 2. The top-level directory is reserved for the standard library, and has precedence over local directory in search path. As a result, OCaml preferred the files installed along with previous LLVM version over the source tree when building a new version, resulting in two versions being mixed during the build. The new layout is used commonly by other OCaml packages, and findlib is able to find the LLVM libraries successfully. Bug: https://bugs.gentoo.org/559134 Bug: https://bugs.gentoo.org/559624 Differential Revision: https://reviews.llvm.org/D24354 llvm-svn: 282895
* Move the ocaml_all target into the Misc folder for cleanliness; NFC.Aaron Ballman2016-09-091-0/+1
| | | | llvm-svn: 281061
* [CMake] [OCaml] Allow building OCaml bindings out of tree.Peter Zotov2016-09-051-3/+9
| | | | | | | | | That is, add build system support for building the OCaml bindings against preinstalled LLVM libraries. This is important for package managers such as OPAM, because OCaml libraries need to be built against a specific OCaml compiler installation. llvm-svn: 280642
* [build] Fixed build break for OCaml bindings.Artem Belevich2016-06-211-1/+7
| | | | | | | After r273302 LLVM_SYSTEM_LIBS may have entries that already have -l prefix and we need to deal with that. llvm-svn: 273333
* [cmake] [OCaml] Make ocamldoc targets depend on output filesPeter Zotov2015-06-071-1/+1
| | | | | | | | | | | | OCaml doc builds fail without .cmi files, and .cmi files are collected in ocaml_outputs. Therefore, make doc targets depend on ocaml_outputs as well. Fixes: https://llvm.org/bugs/show_bug.cgi?id=23777 Patch by Michał Górny <mgorny@gentoo.org> llvm-svn: 239259
* [OCaml] Use $CAMLORIGIN, an rpath-$ORIGIN-like mechanism in OCaml.Peter Zotov2015-01-131-0/+2
| | | | | | | | | | | | | | | 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
* [OCaml] [cmake] Use LLVM_LIBRARY_DIR instead of LLVM_LIBRARY_OUTPUT_INTDIR.Peter Zotov2014-12-301-3/+3
| | | | | | | | The latter variable is internal. Original patch by Ramkumar Ramachandra <artagnon@gmail.com> llvm-svn: 224977
* [OCaml] [cmake] Add CMake buildsystem for OCaml.Peter Zotov2014-12-011-0/+199
Closes PR15325. llvm-svn: 223071
OpenPOWER on IntegriCloud