diff options
author | Alexander Kyte <alexmkyte@gmail.com> | 2018-05-21 20:41:07 +0300 |
---|---|---|
committer | Alexander Kyte <alkyte@microsoft.com> | 2018-06-25 22:09:04 +0300 |
commit | b86070339e62d33879ba658dde67746573a727f3 (patch) | |
tree | 7b58223657253e580b29de438800f2fea08e8115 /llvm | |
parent | c5b88ec4f323f2bdb7c7d0a595ece28dae66579c (diff) |
[runtime] Made mono build llvm if it can't find it
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/Makefile.am | 38 | ||||
-rw-r--r-- | llvm/SUBMODULES.json | 6 |
2 files changed, 39 insertions, 5 deletions
diff --git a/llvm/Makefile.am b/llvm/Makefile.am index cda2a5762f9..b5806f65e73 100644 --- a/llvm/Makefile.am +++ b/llvm/Makefile.am @@ -5,7 +5,11 @@ # into $top_srcdir/llvm/llvm. # -LLVM_PATH=llvm +if INTERNAL_LLVM + +LLVM_PATH ?= $(abs_top_srcdir)/external/llvm +LLVM_BUILD ?= $(abs_top_srcdir)/llvm/build +LLVM_PREFIX ?= $(abs_top_srcdir)/llvm/usr SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json include $(top_srcdir)/scripts/submodules/versions.mk @@ -25,6 +29,36 @@ bump-branch-llvm: __bump-branch-llvm bump-current-llvm: __bump-current-version-llvm clean-local: - $(RM) -r $(LLVM_PATH) + $(RM) -r $(LLVM_PATH) $(LLVM_BUILD) $(LLVM_PREFIX) EXTRA_DIST=SUBMODULES.json + +NINJA:=$(shell which ninja) + +$(LLVM_BUILD) $(LLVM_PREFIX): + mkdir -p $@ + +.PHONY: all-local +all-local: configure-llvm build-llvm install-llvm + +$(LLVM_PATH)/CMakeLists.txt: | reset-llvm + +.PHONY: configure-llvm +configure-llvm: $(LLVM_PATH)/CMakeLists.txt | $(LLVM_BUILD) + cd $(LLVM_BUILD) && cmake \ + $(if $(NINJA),-G Ninja) \ + -DCMAKE_INSTALL_PREFIX="$(LLVM_PREFIX)" \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ + $(LLVM_CMAKE_ARGS) \ + $(dir $<) + +.PHONY: build-llvm +build-llvm: configure-llvm + $(if $(NINJA),$(NINJA),$(MAKE)) -C $(LLVM_BUILD) + +.PHONY: install-llvm +install-llvm: build-llvm | $(LLVM_PREFIX) + $(if $(NINJA),$(NINJA),$(MAKE)) -C $(LLVM_BUILD) install + +endif # INTERNAL_LLVM diff --git a/llvm/SUBMODULES.json b/llvm/SUBMODULES.json index e4fbbb02e87..49e960fb1a5 100644 --- a/llvm/SUBMODULES.json +++ b/llvm/SUBMODULES.json @@ -2,9 +2,9 @@ { "name": "llvm", "url": "git://github.com/mono/llvm.git", - "rev": "9f79399f87282524fee099b328bd8cbf07929daf", - "remote-branch": "origin/master", - "branch": "master", + "rev": "b606857f1dd008486df084481d4eacc5d91041d5", + "remote-branch": "origin/release_60", + "branch": "release_60", "directory": "llvm" } ] |