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.
This commit is contained in:
Konstantin Käfer
2015-04-17 11:43:42 +02:00
committed by Mike Morris
parent 417741b13f
commit f2c9e9fb67
5 changed files with 24 additions and 11 deletions

View File

@@ -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

0
examples/load-from-fs.js Normal file → Executable file
View File

View File

@@ -1,7 +1,7 @@
#include "node_file_source.hpp"
#include "node_request.hpp"
#include <mbgl/storage/default/request.hpp>
#include <mbgl/storage/request.hpp>
#include <mbgl/util/async_queue.hpp>
namespace node_mbgl {

View File

@@ -1,6 +1,6 @@
#include "node_request.hpp"
#include "node_file_source.hpp"
#include <mbgl/storage/default/request.hpp>
#include <mbgl/storage/request.hpp>
#include <mbgl/storage/response.hpp>
#include <cmath>

2
vendor/mbgl vendored