• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    C++
  • Created about 13 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hello world sample for gyp build tool

gyp hello world

Build Status

Build status

GYP can Generate Your Projects.

It is a pre-build system that uses a json config to generate optimized project files for various build tools like make, xcode, visual studio.

For example, it is able to generate make or scons files that run fast.

It is also able to generate xcode and visual studio files.

It's a bit like cmake, except: http://code.google.com/p/gyp/wiki/GypVsCMake

This demo shows how to build:

  • a hello world c++ library (called 'mylib')
  • a command line program that uses/links to it
  • a node.js module that depends on mylib via it gyp file

See also:

Usage

Just grab this sample project and build it:

git clone git://github.com/springmeyer/hello-gyp.git
cd hello-gyp
make

To learn more about how to do this manually, or for different plaforms, read on.

make

The below commands assume you have gyp installed globally. You can do this like:

git clone https://chromium.googlesource.com/external/gyp.git
cd gyp
sudo python setup.py install

build

gyp mylib.gyp --depth=. -f make --generator-output=./build/makefiles
V=1 make -C ./build/makefiles/

test

$ ./build/makefiles/out/Release/myapp
hello

And the node module:

npm install node-gyp
node_modules/.bin/node-gyp configure build

Test the node module:

$ node -e "console.log(require('./build/Release/modulename.node').hello())"
hello

scons

build

gyp mylib.gyp --depth=. -f scons --generator-output=./build/sconsfiles
scons -C ./build/sconsfiles/

test

$ ./build/sconsfiles/Release/myapp
hello

xcode

build

gyp mylib.gyp --depth=. -f xcode --generator-output=./build/xcodefiles
xcodebuild -project ./build/xcodefiles/mylib.xcodeproj

test

# xcode does not respect subdirectory so `build` goes into the main directory
$ ./build/Release/myapp
hello

ninja

Ninja is a build system designed to be ultra fast.

Install it like:

git clone git://github.com/martine/ninja.git
cd ninja
./bootstrap.py
cp ninja /usr/local/bin/

Make sure it works:

$ ninja
ninja: no work to do.

Now go back to the hello-gyp project folder and build the sample:

gyp mylib.gyp --depth=. -f ninja
ninja -v -C out/Release/ -f build.ninja

test

$ ./out/Release/myapp
hello

Microsft Visual Studio C++ 2010 Expres

Note, this assumes you've downloaded and installed the free 2010 C++ studio.

python gyp/gyp mylib.gyp --depth=. -f msvs -G msvs_version=2010
msbuild mylib.sln

test

c:\hello-gyp>Release\myapp.exe
hello

Others

Other formats are some some gyp-specific debugging output

More Repositories

1

arc.js

great circle routes in javascript
JavaScript
368
star
2

libuv-webserver

Pure C (or C++) webserver (and experimental http client) based on libuv and http-parser
C++
147
star
3

tilemill-examples

Example TileMill projects demonstrating hacks and other custom effects
Python
115
star
4

profiling-guide

Basics of performance profiling for C/C++
66
star
5

node-addon-example

Sample starter application for a Node C++ addon packaged with node-pre-gyp
Python
65
star
6

landspeed.js

WMS server using node-mapnik
JavaScript
53
star
7

coalition

simple, fast nodejs + dynamic postgis tile server
JavaScript
44
star
8

quantumnik

Python integration of Mapnik with Quantum GIS
Python
36
star
9

tilelite

Simple python tile server
Python
35
star
10

svg-tiles

Experimenting with SVG tiles in Leaflet
JavaScript
29
star
11

win-osm-workshop

Workshop materials for teaching about OSM on Windows (using QGIS, PostGIS, and TileMill) - designed to work offline
26
star
12

campus-map-tech

Listing of interactive campus maps and the main technology they use
24
star
13

travis-coredump

Sample repo showing how to enable and view C/C++ crash backtraces on travis
Batchfile
20
star
14

mapnik-mongo

mapnik datasource plugin for reading geodata from mongodb
C++
20
star
15

mapnik-c-api

Simple C API to Mapnik
C++
18
star
16

paleoserver

multi-threaded async c++ wms for mapnik
C++
18
star
17

utfgrid-example-writers

Simple reference implementations for creating UTGGrid tiles
Python
17
star
18

nik2img

render mapnik maps on the command line
Python
17
star
19

latlon

get lat lon
16
star
20

geojsonp

Protocol-buffered GeoJSON
Python
15
star
21

grid_renderer_example

Ultra simple working example of interactive vector/raster tiles using mapnik's grid_renderer, generate_tiles.py, openlayers, and wax
Python
15
star
22

geotools2mapnik

Convert SLD into Mapnik XML
Python
14
star
23

how-to-make-slow-maps

If you want slow maps, welcome
13
star
24

node-message-passing

Presentation given at NodeDC April 25th
JavaScript
12
star
25

djmapnik

Easy creation of Mapnik objects within GeoDjango
Python
11
star
26

learn-c

Learning C from scratch (compilers, linkers, build systems)
Shell
11
star
27

antigrain-geometry

Unofficial mirror of http://agg.svn.sourceforge.net/svnroot/agg/ (note: this is not mapnik's internal agg branch that is maintained here: https://github.com/mapnik/mapnik/tree/master/deps/agg)
C++
10
star
28

node-cxx-example

A modern (as of 2020) example of writing a node C++ module
C++
9
star
29

couchdb-mapnik

sample setup for rendering geojson polygons out of couchdb
9
star
30

portable-node-app

TileStream on a stick
Shell
8
star
31

vtiles-jamming-econo

8
star
32

shapely.js

Node.js geometry library
JavaScript
8
star
33

node-mapnik-heroku

8
star
34

download-mbtiles

Example of how to download tiles via http into an mbtiles
JavaScript
7
star
35

mapnik-on-lambda

An example setup for running node-mapnik on AWS lambda hitting PostGIS on AWS RDS
JavaScript
7
star
36

grid_renderer

playing with scanlines
C
6
star
37

healthcare.gov

JavaScript
6
star
38

mapserver2mapnik

python conversion from mapserver mapfile to mapnik xml
Python
4
star
39

wkt-parsing-benchmark

testing code for benchmarking wkt geometry parsing
C++
4
star
40

build-llvm

DEPRECATED - Script to build latest llvm, clang, lldb, and include-what-you-use
Shell
4
star
41

boringssl-build

Build boringssl
Shell
4
star
42

qgis_osm_import_ui

QGIS plugin wrapping osmosis and osm2pgsql to provide a basic graphical user interface
Python
3
star
43

render-collections

sample style and notes around rendering geometry collections from postgis
3
star
44

up-to-date

how to use osm2pgsql and osmosis to keep an up to date postgis osm planet database
3
star
45

glibcxx-symbol-versioning

Sample code to demonstrate how libstdc++ symbol versioning works
C++
3
star
46

kml-escape

Convert KML styles and data into Mapnik stylesheet
Python
3
star
47

hello-android-ndk

Sample Android JNI application demonstrating cross compiling and linking external library
3
star
48

node-osmium

MOVED TO https://github.com/osmcode/node-osmium
C++
3
star
49

boost-geometry-line-clipping-testcase

C++
2
star
50

vector-tile-query-bench

Compare rendering UTFGrid from vector tile vs querying raw data and performing hit test
JavaScript
2
star
51

mapnik-bugs

stash of data related to mapnik bugs
2
star
52

wtf-sqlite3

grab sqlite3's compile/config options via a simple c program
C
2
star
53

vtile-as-json

Experiment providing MapBox vector tiles as json
JavaScript
2
star
54

mapjig

Mapnik OSM stylesheets to serve as templates for making woodcut maps
2
star
55

seaweed

random scripts
Python
2
star
56

sqlite3-mapnik

standalone build of mapnik sqlite plugin
JavaScript
2
star
57

wa-urisa-presentation

Presentation given at WA URISA May 8, 2012
JavaScript
2
star
58

npm-dep-test4

2
star
59

cugos-tilemill-intro-presentation

Presentation given at CUGOS spring fling - May 16, 2012
JavaScript
2
star
60

winmain

win main tests
Python
2
star
61

vector-tile-java

Java library for efficient reading of Mapbox Vector Tiles
Java
2
star
62

codecov-test

JavaScript
1
star
63

squid-proxy-travis

1
star
64

cloudless-nacis2013

Talk given at NACIS on MapBox Cloudless Atlas
JavaScript
1
star
65

travis-tests

Shell
1
star
66

osm2pgsql-svn

SVN mirror + windows build files
C
1
star
67

postgis-mason-install

Example and tests of installing PostGIS via Mason
Shell
1
star
68

elb2h2load

Convert elb logs to h2load uris
JavaScript
1
star
69

server-timing-sparklines

Scripts to visualize server-timing headers
Shell
1
star
70

foss4g2011

Slides from Foss4g 2012 workshop
JavaScript
1
star
71

gdal-atexit-crash

Testcase for gdal crash at exit
C++
1
star
72

node-addon-env-debug

Testcase for how process.env works in Node.js across platforms
C++
1
star
73

build2-testcase

Testcase of build2 0.6.2 hang
C++
1
star
74

npm-dep-test1

1
star
75

node-request-proxy-test

Test code for understanding and debugging proxies with node.js
JavaScript
1
star
76

npm-dep-test3

1
star
77

libnew

Count allocations at runtime, print them at exit.
C++
1
star
78

geom-ops-bench

Benchmark geometry operations (currently via node.js)
JavaScript
1
star
79

deanbrew

http://springmeyer.github.io/deanbrew/
JavaScript
1
star
80

vt-encode-js

Encode sample data vector tile in js
JavaScript
1
star
81

mapnik-raster-overzoom

Testcase for Mapnik raster overzooming
Python
1
star
82

vector-tile-overzoom-demo

JavaScript
1
star
83

cugos-2019

Talk given at CUGOS 2019 conference
JavaScript
1
star
84

shared-library-path

sample code to test finding the absolute path to a shared library across platforms
C++
1
star