diff options
-rw-r--r-- | .travis.yml | 17 | ||||
-rw-r--r-- | Makefile | 31 | ||||
-rwxr-xr-x | bin/build-shaders.js | 4 | ||||
-rwxr-xr-x | configure | 9 | ||||
-rwxr-xr-x | deps/run_gyp | 4 | ||||
-rw-r--r-- | llmr.gyp | 4 |
6 files changed, 31 insertions, 38 deletions
diff --git a/.travis.yml b/.travis.yml index 50857eb68e..d1460572ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,21 +6,12 @@ compiler: before_install: - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test +- sudo add-apt-repository --yes ppa:boost-latest/ppa - sudo apt-get update -qq - sudo apt-get -y install gcc-4.8 g++-4.8 -- sudo apt-get -y install git cmake make pkg-config libboost-dev libpng-dev -- sudo apt-get -y install libxi-dev libglu1-mesa-dev x11proto-randr-dev x11proto-xext-dev libxrandr-dev x11proto-xf86vidmode-dev libxxf86vm-dev - -install: -- export CURRENT_DIR=$(pwd) -- git clone https://github.com/glfw/glfw.git -- cd glfw -- mkdir build -- cd build -- cmake ../ -DCMAKE_C_COMPILER_ENV_VAR=gcc-4.8 -- make -- sudo make install -- cd ${CURRENT_DIR} +- sudo apt-get -y install pkg-config nodejs +- sudo apt-get -y install libboost1.55-dev libpng-dev libcurl4-openssl-dev +- sudo apt-get -y install libglu1-mesa-dev before_script: - export CXX="g++-4.8" @@ -6,77 +6,70 @@ V ?= 1 all: llmr -deps: glsl-optimizer - -llmr: deps config.gypi src llmr.gyp +llmr: config.gypi src llmr.gyp deps/run_gyp llmr.gyp -Goutput_dir=./out/ --depth=. --generator-output=./out -f make make -j8 -C out BUILDTYPE=Release V=$(V) llmr-x86 -gtest: deps config.gypi src llmr.gyp +gtest: config.gypi src llmr.gyp deps/run_gyp llmr.gyp -Goutput_dir=./out/ --depth=. --generator-output=./build/gtest -f make make -C build/gtest gtest V=$(V) # build OS X app with pure make -app: deps config.gypi src macosx/llmr-app.gyp +app: config.gypi src macosx/llmr-app.gyp deps/run_gyp macosx/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./build/macosx-make -f make make -C build/macosx-make V=$(V) open build/macosx-make/out/Release/llmr.app -linux: deps config.gypi src linux/llmr-app.gyp +linux: config.gypi src linux/llmr-app.gyp deps/run_gyp linux/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./build/linux-make -f make make -C build/linux-make V=$(V) ./build/linux-make/out/Release/llmr.app # build OS X app with Xcode -lproj: deps config.gypi src linux/llmr-app.gyp +lproj: config.gypi src linux/llmr-app.gyp deps/run_gyp linux/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode open ./linux/llmr-app.xcodeproj # build just xcode project for libllmr -xcode: deps config.gypi llmr.gyp +xcode: config.gypi llmr.gyp deps/run_gyp llmr.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode # build OS X app with Xcode -xproj: deps config.gypi src macosx/llmr-app.gyp +xproj: config.gypi src macosx/llmr-app.gyp deps/run_gyp macosx/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode open ./macosx/llmr-app.xcodeproj # build OS X app with xcodebuild -xapp: deps config.gypi src macosx/llmr-app.gyp +xapp: config.gypi src macosx/llmr-app.gyp deps/run_gyp macosx/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode xcodebuild -project ./macosx/llmr-app.xcodeproj open macosx/build/Release/llmr.app # build iOS app with Xcode -iproj: deps config.gypi src ios/llmr-app.gyp +iproj: config.gypi src ios/llmr-app.gyp deps/run_gyp ios/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode open ./ios/llmr-app.xcodeproj # build iOS app with xcodebuild -iapp: deps config.gypi src ios/llmr-app.gyp +iapp: config.gypi src ios/llmr-app.gyp deps/run_gyp ios/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode xcodebuild -project ./ios/llmr-app.xcodeproj # launch app with ios-sim? -isim: deps config.gypi src ios/llmr-app.gyp +isim: config.gypi src ios/llmr-app.gyp deps/run_gyp ios/llmr-app.gyp -Goutput_dir=./out/ --depth=. --generator-output=./ -f xcode xcodebuild -project ./ios/llmr-app.xcodeproj -arch i386 -sdk iphonesimulator # does not work #"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator" -SimulateApplication ios/build/Release-iphonesimulator/llmr.app/llmr -test: deps config.gypi src test/test.gyp +test: config.gypi src test/test.gyp deps/run_gyp test/test.gyp -Goutput_dir=. --depth=. --generator-output=./build/test -f make make -C build/test V=$(V) @for FILE in build/test/Release/test_*; do \ $${FILE}; \ done -glsl-optimizer: bin/node_modules/glsl-optimizer/build/Release/glslOptimizer.node - -bin/node_modules/glsl-optimizer/build/Release/glslOptimizer.node: - cd bin && npm install - clean: -rm -rf out -rm -rf build diff --git a/bin/build-shaders.js b/bin/build-shaders.js index 7e43a8f730..60d510907a 100755 --- a/bin/build-shaders.js +++ b/bin/build-shaders.js @@ -3,7 +3,8 @@ var fs = require('fs'); var path = require('path'); -var glsl = require('glsl-optimizer'); + +try { var glsl = require('glsl-optimizer'); } catch(err) {} module.exports = function(shader_type, root) { var name; @@ -11,7 +12,6 @@ module.exports = function(shader_type, root) { var shaderFiles = fs.readdirSync('src/shader'); - // Load shaders for (var i = 0; i < shaderFiles.length; i++) { var parts = shaderFiles[i].match(/^(.+)\.(vertex|fragment)\.glsl$/); @@ -17,6 +17,11 @@ parser.add_option("--debug", dest="debug", help="Also build debug build") +parser.add_option("--node", + action="store", + dest="node", + help="Name of the node executable (defaults to node)") + parser.add_option("--pkg-config-root", action="store", dest="pkgconfig_root", @@ -48,6 +53,10 @@ def configure_llmr(o): o['variables']['boost_root'] = options.boost_root else: o['variables']['boost_root'] = '/usr/local' + if options.node: + o['variables']['node'] = options.node + else: + o['variables']['node'] = 'node' o['target_defaults']['default_configuration'] = 'Debug' if options.debug else 'Release' def configure_glfw3(o): diff --git a/deps/run_gyp b/deps/run_gyp index 6f14ef163a..f25d50a5dd 100755 --- a/deps/run_gyp +++ b/deps/run_gyp @@ -1,8 +1,8 @@ #!/usr/bin/env python import sys import os.path -sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'gyp', 'pylib')) +sys.path.insert(1, os.path.join(os.path.dirname(sys.argv[0]), 'gyp', 'pylib')) import gyp if __name__ == '__main__': - sys.exit(gyp.script_main())
\ No newline at end of file + sys.exit(gyp.script_main()) @@ -18,7 +18,7 @@ 'src/shader/shaders_gl.cpp', 'src/shader/shaders_gles2.cpp', ], - 'action': ['bin/build-shaders.js'], + 'action': ['<@(node)', 'bin/build-shaders.js'], } ] }, @@ -35,7 +35,7 @@ 'include/llmr/style/resources.hpp', 'src/style/resources.cpp' ], - 'action': ['bin/build-style.js'] + 'action': ['<@(node)', 'bin/build-style.js'] } ], }, |