poly2tri/wscript

48 lines
1.2 KiB
Plaintext
Raw Normal View History

2012-07-12 19:56:16 +02:00
#!/usr/bin/env python
2011-03-08 15:12:11 +01:00
# encoding: utf-8
2012-02-04 21:49:38 +01:00
# waf 1.6.10
2011-03-08 15:12:11 +01:00
VERSION='0.3.3'
2010-01-17 17:41:09 +01:00
import sys
APPNAME='p2t'
2011-03-08 15:12:11 +01:00
top = '.'
out = 'build'
2010-01-17 17:41:09 +01:00
2011-03-08 15:12:11 +01:00
CPP_SOURCES = ['poly2tri/common/shapes.cc',
'poly2tri/sweep/cdt.cc',
'poly2tri/sweep/advancing_front.cc',
'poly2tri/sweep/sweep_context.cc',
'poly2tri/sweep/sweep.cc',
'testbed/main.cc']
2010-04-25 18:40:54 +02:00
2011-03-08 15:12:11 +01:00
from waflib.Tools.compiler_cxx import cxx_compiler
cxx_compiler['win32'] = ['g++']
2010-04-25 18:40:54 +02:00
2010-01-17 17:41:09 +01:00
#Platform specific libs
if sys.platform == 'win32':
# MS Windows
sys_libs = ['glfw', 'opengl32']
2010-04-25 18:40:54 +02:00
elif sys.platform == 'darwin':
2010-01-17 17:41:09 +01:00
# Apple OSX
2012-07-12 19:56:16 +02:00
sys_libs = ['glfw']
2010-01-17 17:41:09 +01:00
else:
# GNU/Linux, BSD, etc
sys_libs = ['glfw', 'GL']
2010-04-25 18:40:54 +02:00
2011-03-08 15:12:11 +01:00
def options(opt):
print(' set_options')
opt.load('compiler_cxx')
2010-04-25 18:40:54 +02:00
2010-01-17 17:41:09 +01:00
def configure(conf):
2011-03-08 15:12:11 +01:00
print(' calling the configuration')
conf.load('compiler_cxx')
conf.env.CXXFLAGS = ['-O3', '-ffast-math']
conf.env.DEFINES_P2T = ['P2T']
conf.env.LIB_P2T = sys_libs
2012-07-12 19:56:16 +02:00
if sys.platform == 'darwin':
conf.env.FRAMEWORK = ['OpenGL', 'Cocoa']
2010-04-25 18:40:54 +02:00
2010-01-17 17:41:09 +01:00
def build(bld):
print(' building')
2011-03-08 15:12:11 +01:00
bld.program(features = 'cxx cxxprogram', source=CPP_SOURCES, target = 'p2t', uselib = 'P2T')