Permalink
Browse files

Merge pull request #20 from steinwurf/use-new-waf

Use new waf
  • Loading branch information...
petya2164 committed Mar 29, 2017
2 parents 85b5e1e + 543590e commit 792c097b8881a4cdfe6aa9c92b400e69d33593b7
Showing with 50 additions and 48 deletions.
  1. +7 −2 .gitignore
  2. +4 −4 buildbot.py
  3. +21 −10 config.py
  4. +9 −0 resolve.json
  5. +9 −9 waf
  6. +0 −23 wscript
View
@@ -24,12 +24,15 @@
# Compiled Doxygen documentation
/doxygen/html
# For projects that use Waf for building: http://code.google.com/p/waf/
# Waf files
waf-*
waf3-*
.waf-*
.waf3-*
.lock-*
build
bundle_dependencies
resolve_symlinks
resolved_dependencies
# Gnu Global tag files
GPATH
@@ -39,6 +42,7 @@ GTAGS
# Emacs temp / auto save
\#*#
*.#*
*~
#Eclipse ignore
@@ -58,4 +62,5 @@ local.properties
*.sdf
*.opensdf
*.log
*.vcxproj*
VSProjects
View
@@ -34,13 +34,13 @@ def configure(properties):
if properties.get('build_distclean'):
command += ['distclean']
command += ['configure', '--git-protocol=git@']
command += ['configure', '--git_protocol=git@']
if 'waf_bundle_path' in properties:
command += ['--bundle-path=' + properties['waf_bundle_path']]
if 'waf_resolve_path' in properties:
command += ['--resolve_path=' + properties['waf_resolve_path']]
if 'dependency_project' in properties:
command += ['--{0}-use-checkout={1}'.format(
command += ['--{0}_checkout={1}'.format(
properties['dependency_project'],
properties['dependency_checkout'])]
View
@@ -1,16 +1,23 @@
#!/usr/bin/env python
# encoding: utf-8
import urllib2
import traceback
import sys
try:
input = raw_input
except NameError:
pass
project_name = 'gtest'
project_dependencies = ['waf-tools']
project_dependencies = \
[
'waf-tools',
]
# Importing a dynamically generated module
# Python recipe from http://code.activestate.com/recipes/82234
def importCode(code, name, add_to_sys_modules=0):
"""
Import dynamically generated code as a module. code is the
@@ -31,12 +38,11 @@ def importCode(code, name, add_to_sys_modules=0):
Returns a newly generated module.
"""
import sys
import imp
module = imp.new_module(name)
exec code in module.__dict__
exec(code, module.__dict__)
if add_to_sys_modules:
sys.modules[name] = module
@@ -49,22 +55,27 @@ def importCode(code, name, add_to_sys_modules=0):
url = "https://raw.github.com/steinwurf/steinwurf-labs/" \
"master/config_helper/config-impl.py"
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, Request
try:
# Fetch the code file from the given url
req = urllib2.Request(url)
response = urllib2.urlopen(req)
req = Request(url)
response = urlopen(req)
code = response.read()
print("Update complete. Code size: {}\n".format(len(code)))
try:
# Import the code string as a module
mod = importCode(code, "config_helper")
# Run the actual config tool from the dynamic module
mod.config_tool(project_dependencies)
mod.config_tool(project_dependencies, project_name)
except:
print("Unexpected error:")
print traceback.format_exc()
print(traceback.format_exc())
except Exception as e:
print("Could not fetch code file from:\n\t{}".format(url))
print(e)
raw_input('Press ENTER to exit...')
input('Press ENTER to exit...')
View
@@ -0,0 +1,9 @@
[
{
"name": "waf-tools",
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/waf-tools.git"]
}
]
View
18 waf

Large diffs are not rendered by default.

Oops, something went wrong.
View
23 wscript
@@ -4,30 +4,9 @@
APPNAME = 'gtest'
VERSION = '3.0.0'
import waflib.extras.wurf_options
def options(opt):
opt.load('wurf_common_tools')
def resolve(ctx):
import waflib.extras.wurf_dependency_resolve as resolve
ctx.load('wurf_common_tools')
ctx.add_dependency(resolve.ResolveVersion(
name='waf-tools',
git_repository='github.com/steinwurf/waf-tools.git',
major=3))
def configure(conf):
conf.load('wurf_common_tools')
if conf.is_mkspec_platform('linux'):
if not conf.env['LIB_PTHREAD']:
# If we have not looked for pthread yet
@@ -36,8 +15,6 @@ def configure(conf):
def build(bld):
bld.load('wurf_common_tools')
bld.env.append_unique(
'DEFINES_STEINWURF_VERSION',
'STEINWURF_GTEST_VERSION="{}"'.format(VERSION))

0 comments on commit 792c097

Please sign in to comment.