Skip to content

Commit

Permalink
Support Xcode project creation with waf
Browse files Browse the repository at this point in the history
  • Loading branch information
jpauwels committed Jul 26, 2022
1 parent 5c3fdbc commit 863128b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
9 changes: 2 additions & 7 deletions src/bindings/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ def configure(conf):
conf.check_python_version((3,5))
conf.check_python_headers()

# do not use the default extension of .bundle on MacOS
# TODO: still necessary with waf 1.5.x?
if sys.platform == 'darwin':
conf.env['pyext_SUFFIX'] = '.so'

conf.env['CPPPATH_BINDINGS'] = [ '../../src',
'../../src/bindings',
'../../src/metrics',
Expand All @@ -48,15 +43,15 @@ def build(bld):
#if major >= 2 and minor >= 6:
# bld.env['PYTHONDIR'] = bld.env['PYTHONDIR'].replace('site-packages', 'dist-packages')

bld(features = 'cxx cshlib pyext',
bld.shlib(features = 'cxx cshlib pyext',
source = 'gaia.swig',
target = '_gaia2',
# -w 451: ignore the warning "Setting a const char * variable may leak memory"
swig_flags = '-c++ -python -w451',
use = ['gaia2'] + bld.env['USELIB'], # + ['BINDINGS'],
includes = bld.env['CPPPATH_BINDINGS'],
install_path = '${PYTHONDIR}/gaia2'
)
)

bld.install_as('${PYTHONDIR}/gaia2/__init__.py', 'gaia2.py')
bld.install_files('${PYTHONDIR}/gaia2', bld.path.ant_glob('pygaia/*.py'))
Expand Down
9 changes: 9 additions & 0 deletions update-waf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

VERSION=2.0.24
TMP_DIR=./waf-repo

git clone --depth=1 --branch=waf-${VERSION} -c advice.detachedHead=false https://gitlab.com/ita1024/waf.git ${TMP_DIR}
${TMP_DIR}/waf-light --tools=swig,c_emscripten,xcode6 --make-waf -t ${TMP_DIR}
cp ${TMP_DIR}/waf .
rm -rf ${TMP_DIR}
14 changes: 7 additions & 7 deletions waf

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ out = 'build'


def options(opt):
opt.load('compiler_cxx compiler_c qt4')
opt.load('compiler_cxx compiler_c qt4 xcode6')
opt.recurse('src')

# whether or not to have all the asserts working
Expand Down Expand Up @@ -208,6 +208,7 @@ def configure(conf):
pcfile = '\n'.join([ l.strip() for l in pcfile.split('\n') ])
conf.env.pcfile = pcfile
#open('build/gaia2.pc', 'w').write(pcfile) # we'll do it later on the build stage
conf.load('xcode6')


def build(bld):
Expand Down

0 comments on commit 863128b

Please sign in to comment.