add xcode project builds
This commit is contained in:
25
Makefile
25
Makefile
@@ -33,18 +33,35 @@ linux: config.gypi linux/llmr-app.gyp
|
||||
deps/run_gyp linux/llmr-app.gyp --depth=. -Goutput_dir=.. --generator-output=./build/linux -f make
|
||||
make -C build/linux V=$(V) linuxapp
|
||||
|
||||
# Executes the linux binary
|
||||
# Executes the Linux binary
|
||||
run-linux: linux
|
||||
build/Release/llmr
|
||||
|
||||
|
||||
##### Xcode projects ###########################################################
|
||||
|
||||
# build Mac OS X project for Xcode
|
||||
xproj: config.gypi macosx/llmr-app.gyp
|
||||
deps/run_gyp macosx/llmr-app.gyp --depth=. --generator-output=./build -f xcode
|
||||
open ./build/macosx/llmr-app.xcodeproj
|
||||
|
||||
# build iOS project for Xcode
|
||||
iproj: config.gypi ios/llmr-app.gyp
|
||||
deps/run_gyp ios/llmr-app.gyp --depth=. --generator-output=./build -f xcode
|
||||
open ./build/ios/llmr-app.xcodeproj
|
||||
|
||||
# build Linux project for Xcode (Runs on Mac OS X too, but without platform-specific code)
|
||||
lproj: config.gypi linux/llmr-app.gyp
|
||||
deps/run_gyp linux/llmr-app.gyp --depth=. --generator-output=./build -f xcode
|
||||
open ./build/linux/llmr-app.xcodeproj
|
||||
|
||||
|
||||
##### Maintenace operations ####################################################
|
||||
|
||||
clean:
|
||||
-rm -rf build/Release
|
||||
-rm -rf ./build/Release
|
||||
|
||||
distclean:
|
||||
-rm -rf build
|
||||
distclean: clean
|
||||
-rm -rf ./build
|
||||
|
||||
.PHONY: llmr test linux
|
||||
|
||||
@@ -7,7 +7,7 @@ var lazy_update = require('./lazy-update');
|
||||
|
||||
try { var glsl = require('glsl-optimizer'); } catch(err) {}
|
||||
|
||||
module.exports = function(shader_type) {
|
||||
module.exports = function(shader_type, prefix, suffix) {
|
||||
var name;
|
||||
var shaders = {};
|
||||
|
||||
@@ -105,6 +105,8 @@ module.exports = function(shader_type) {
|
||||
|
||||
|
||||
var code = '// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.\n';
|
||||
code += '#include <llmr/platform/gl.hpp>\n';
|
||||
code += prefix + '\n';
|
||||
code += '#include <llmr/shader/shaders.hpp>\n';
|
||||
code += '\n';
|
||||
code += 'using namespace llmr;\n';
|
||||
@@ -112,10 +114,12 @@ module.exports = function(shader_type) {
|
||||
code += 'const shader_source llmr::shaders[SHADER_COUNT] = {\n';
|
||||
code += lines.join(',\n');
|
||||
code += '\n};\n';
|
||||
code += suffix + '\n';
|
||||
|
||||
|
||||
lazy_update('include/llmr/shader/shaders.hpp', header);
|
||||
lazy_update('src/shader/shaders_' + shader_type + '.cpp', code);
|
||||
};
|
||||
|
||||
module.exports('gl');
|
||||
module.exports('gles2');
|
||||
module.exports('gl', '#ifndef GL_ES_VERSION_2_0', '#endif');
|
||||
module.exports('gles2', '#ifdef GL_ES_VERSION_2_0', '#endif');
|
||||
|
||||
7
configure
vendored
7
configure
vendored
@@ -59,12 +59,17 @@ def configure_llmr(o):
|
||||
o['variables']['node'] = 'node'
|
||||
o['target_defaults']['default_configuration'] = 'Debug' if options.debug else 'Release'
|
||||
|
||||
|
||||
def fix_frameworks(libs):
|
||||
# don't split "-framework Foo"
|
||||
return re.split('(?<!-framework)\s+', libs.strip())
|
||||
|
||||
def configure_glfw3(o):
|
||||
ret = pkg_config('glfw3', options.pkgconfig_root)
|
||||
if not ret:
|
||||
sys.stderr.write('could not find glfw3 with pkg-config')
|
||||
sys.exit(-1)
|
||||
o['variables']['glfw3_libraries'] = ret[0].split()
|
||||
o['variables']['glfw3_libraries'] = fix_frameworks(ret[0])
|
||||
o['variables']['glfw3_cflags'] = ret[1].split()
|
||||
|
||||
def configure_uv(o):
|
||||
|
||||
@@ -1,72 +1,55 @@
|
||||
{
|
||||
'includes': [
|
||||
'../common.gypi',
|
||||
'../config.gypi'
|
||||
'../config.gypi',
|
||||
],
|
||||
'targets': [
|
||||
{
|
||||
"target_name": "linuxapp",
|
||||
"product_name": "llmr",
|
||||
"type": "executable",
|
||||
"sources": [
|
||||
"./main.cpp",
|
||||
"./settings.cpp",
|
||||
"./settings.hpp",
|
||||
"./request.cpp",
|
||||
"./request.hpp"
|
||||
],
|
||||
'conditions': [
|
||||
['OS == "mac"', {
|
||||
'product_extension': 'app',
|
||||
'mac_bundle': 1,
|
||||
'mac_bundle_resources': [
|
||||
'../macosx/Icon.icns',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
|
||||
'$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
|
||||
],
|
||||
},
|
||||
'xcode_settings': {
|
||||
'ARCHS': [ "x86_64" ],
|
||||
'SDKROOT': 'macosx',
|
||||
'SUPPORTED_PLATFORMS':'macosx',
|
||||
'OTHER_CPLUSPLUSFLAGS':[
|
||||
'<@(glfw3_cflags)'
|
||||
'<@(curl_cflags)'
|
||||
],
|
||||
'OTHER_LDFLAGS': [
|
||||
'-stdlib=libc++',
|
||||
'<@(glfw3_libraries)',
|
||||
'<@(curl_libraries)',
|
||||
],
|
||||
'SDKROOT': 'macosx',
|
||||
'INFOPLIST_FILE': '../macosx/Info.plist',
|
||||
'CLANG_CXX_LIBRARY': 'libc++',
|
||||
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
|
||||
'MACOSX_DEPLOYMENT_TARGET':'10.9',
|
||||
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES'
|
||||
},
|
||||
}, {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<@(glfw3_libraries)',
|
||||
'<@(curl_libraries)',
|
||||
],
|
||||
},
|
||||
'cflags': [
|
||||
'<@(glfw3_cflags)',
|
||||
'<@(curl_cflags)'
|
||||
],
|
||||
}]
|
||||
],
|
||||
"dependencies": [
|
||||
"../llmr.gyp:llmr-x86"
|
||||
]
|
||||
}
|
||||
]
|
||||
'target_name': 'linuxapp',
|
||||
'product_name': 'llmr',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'./main.cpp',
|
||||
'./settings.cpp',
|
||||
'./settings.hpp',
|
||||
'./request.cpp',
|
||||
'./request.hpp',
|
||||
],
|
||||
|
||||
'conditions': [
|
||||
['OS == "mac"',
|
||||
|
||||
# Mac OS X
|
||||
{
|
||||
'xcode_settings': {
|
||||
'OTHER_CPLUSPLUSFLAGS':[
|
||||
'<@(glfw3_cflags)',
|
||||
'<@(curl_cflags)',
|
||||
],
|
||||
'OTHER_LDFLAGS': [
|
||||
'<@(glfw3_libraries)',
|
||||
'<@(curl_libraries)',
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
# Non-Mac OS X
|
||||
{
|
||||
'cflags': [
|
||||
'<@(glfw3_cflags)',
|
||||
'<@(curl_cflags)',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<@(glfw3_libraries)',
|
||||
'<@(curl_libraries)',
|
||||
],
|
||||
},
|
||||
}],
|
||||
],
|
||||
'dependencies': [
|
||||
'../llmr.gyp:llmr-x86',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
#include <llmr/platform/gl.hpp>
|
||||
#ifndef GL_ES_VERSION_2_0
|
||||
#include <llmr/shader/shaders.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
@@ -37,3 +39,4 @@ const shader_source llmr::shaders[SHADER_COUNT] = {
|
||||
"#version 120\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float edge0_1;\n edge0_1 = (u_buffer - u_gamma);\n float tmpvar_2;\n tmpvar_2 = clamp (((texture2D (u_texture, v_tex).w - edge0_1) / (\n (u_buffer + u_gamma)\n - edge0_1)), 0.0, 1.0);\n gl_FragColor = (u_color * ((tmpvar_2 * \n (tmpvar_2 * (3.0 - (2.0 * tmpvar_2)))\n ) * v_alpha));\n}\n\n",
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
|
||||
#include <llmr/platform/gl.hpp>
|
||||
#ifdef GL_ES_VERSION_2_0
|
||||
#include <llmr/shader/shaders.hpp>
|
||||
|
||||
using namespace llmr;
|
||||
@@ -37,3 +39,4 @@ const shader_source llmr::shaders[SHADER_COUNT] = {
|
||||
"precision highp float;\nuniform sampler2D u_texture;\nuniform vec4 u_color;\nuniform float u_buffer;\nuniform float u_gamma;\nvarying vec2 v_tex;\nvarying float v_alpha;\nvoid main ()\n{\n float edge0_1;\n edge0_1 = (u_buffer - u_gamma);\n lowp float tmpvar_2;\n tmpvar_2 = clamp (((texture2D (u_texture, v_tex).w - edge0_1) / (\n (u_buffer + u_gamma)\n - edge0_1)), 0.0, 1.0);\n lowp vec4 tmpvar_3;\n tmpvar_3 = (u_color * ((tmpvar_2 * \n (tmpvar_2 * (3.0 - (2.0 * tmpvar_2)))\n ) * v_alpha));\n gl_FragColor = tmpvar_3;\n}\n\n",
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user