Browse Source

[nvim]: fix LS sysimage building on macos.

master
Fredrik Ekre 4 years ago
parent
commit
a30f7c031b
  1. 17
      .julia/environments/nvim-lspconfig/Makefile

17
.julia/environments/nvim-lspconfig/Makefile

@ -1,9 +1,14 @@ @@ -1,9 +1,14 @@
JULIA=$(shell which julia)
JULIA_PROJECT=
default: languageserver.so
ifeq ($(shell uname -s),Linux)
SYSIMAGE=languageserver.so
else
SYSIMAGE=languageserver.dylib
endif
default: $(SYSIMAGE)
languageserver.so: Manifest.toml packagecompiler/Manifest.toml packagecompiler/precompile_statements.jl
JULIA_LOAD_PATH=${PWD}:${PWD}/packagecompiler:@stdlib ${JULIA} -e 'using PackageCompiler; PackageCompiler.create_sysimage(:LanguageServer, sysimage_path="languageserver.so", precompile_statements_file="packagecompiler/precompile_statements.jl")'
$(SYSIMAGE): Manifest.toml packagecompiler/Manifest.toml packagecompiler/precompile_statements.jl
JULIA_LOAD_PATH=${PWD}:${PWD}/packagecompiler:@stdlib ${JULIA} -e 'using PackageCompiler; PackageCompiler.create_sysimage(:LanguageServer, sysimage_path="$(SYSIMAGE)", precompile_statements_file="packagecompiler/precompile_statements.jl")'
Manifest.toml: Project.toml
JULIA_LOAD_PATH=${PWD}/Project.toml:@stdlib ${JULIA} -e 'using Pkg; Pkg.instantiate()'
@ -55,14 +60,14 @@ bin/julia: @@ -55,14 +60,14 @@ bin/julia:
echo "JULIA=${JULIA}" >> bin/julia
echo "if [[ \$${JULIA_TRACE_COMPILE} = \"1\" ]]; then" >> bin/julia
echo " exec \$${JULIA} --trace-compile=${PWD}/packagecompiler/precompile_statements.jl \"\$$@\"" >> bin/julia
echo "elif [[ -f ${PWD}/languageserver.so ]]; then" >> bin/julia
echo " exec \$${JULIA} --sysimage=${PWD}/languageserver.so \"\$$@\"" >> bin/julia
echo "elif [[ -f ${PWD}/$(SYSIMAGE) ]]; then" >> bin/julia
echo " exec \$${JULIA} --sysimage=${PWD}/$(SYSIMAGE) \"\$$@\"" >> bin/julia
echo "else" >> bin/julia
echo " exec \$${JULIA} \"\$$@\"" >> bin/julia
echo "fi" >> bin/julia
chmod +x bin/julia
clean:
rm -rf languageserver.so packagecompiler bin
rm -rf $(SYSIMAGE) packagecompiler bin
.PHONY: clean default

Loading…
Cancel
Save