From f2c9e9fb67854b700b61c9f80ffc26404b8606f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 17 Apr 2015 11:43:42 +0200 Subject: [PATCH] add xcode project target Use locally installed node-pre-gyp if there's no global one. This is necessary to be able to run make outside of npm. Make example executable. Change path to the request include file. Bump mbgl to master. --- Makefile | 29 +++++++++++++++++++++-------- examples/load-from-fs.js | 0 src/node_file_source.cpp | 2 +- src/node_request.cpp | 2 +- vendor/mbgl | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) mode change 100644 => 100755 examples/load-from-fs.js diff --git a/Makefile b/Makefile index 52ce7db88..d66f6ad1c 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,11 @@ JOBS = $(shell nproc) endif endif +NODE_PRE_GYP = $(shell which node-pre-gyp) +ifeq ($(NODE_PRE_GYP),) +NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp +endif + # Explicitly disable the default FileSource implementation ASSET = none HTTP = none @@ -30,20 +35,28 @@ global: build .PHONY: build build: build/Makefile - @node-pre-gyp build $(DEBUG_FLAG) --clang -- -j$(JOBS) + @$(NODE_PRE_GYP) build $(DEBUG_FLAG) --clang -- -j$(JOBS) vendor/mbgl: git submodule update --init +GYP_SETTINGS = -Dmbgl=$(MBGL) \ + -Dhost=$(HOST) \ + -I$(MBGL)/config/$(HOST).gypi \ + $(LIBS_$(HOST)) \ + -Duv_static_libs= -Duv_ldflags= + .PHONY: build/Makefile build/Makefile: $(MBGL)/config/$(HOST).gypi - @node-pre-gyp configure --clang -- \ - -Dmbgl=$(MBGL) \ - -Dhost=$(HOST) \ - -I$(MBGL)/config/$(HOST).gypi \ - $(LIBS_$(HOST)) \ - -Duv_static_libs= -Duv_ldflags= \ - -Goutput_dir=. + @$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f make + +.PHONY: build/binding.xcodeproj +build/binding.xcodeproj: $(MBGL)/config/$(HOST).gypi + @$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f xcode + +.PHONY: xproj +xproj: build/binding.xcodeproj + open build/binding.xcodeproj $(MBGL)/config/%.gypi: $(MBGL) $(MBGL)/configure make -C $(MBGL) config/$*.gypi diff --git a/examples/load-from-fs.js b/examples/load-from-fs.js old mode 100644 new mode 100755 diff --git a/src/node_file_source.cpp b/src/node_file_source.cpp index 9621132a8..e50237f48 100644 --- a/src/node_file_source.cpp +++ b/src/node_file_source.cpp @@ -1,7 +1,7 @@ #include "node_file_source.hpp" #include "node_request.hpp" -#include +#include #include namespace node_mbgl { diff --git a/src/node_request.cpp b/src/node_request.cpp index 415d27d82..b67fd2097 100644 --- a/src/node_request.cpp +++ b/src/node_request.cpp @@ -1,6 +1,6 @@ #include "node_request.hpp" #include "node_file_source.hpp" -#include +#include #include #include diff --git a/vendor/mbgl b/vendor/mbgl index f221fc7af..7827d4954 160000 --- a/vendor/mbgl +++ b/vendor/mbgl @@ -1 +1 @@ -Subproject commit f221fc7af5b29edf87cf670acdfc9e7b775a34e1 +Subproject commit 7827d4954cea5b4fcfce3f245aae2e8c66e0ccb2