Remove Waf build system, fix #14

This commit is contained in:
Jan Niklas Hasse 2020-11-06 22:37:50 +00:00
parent e9938d9c68
commit 83680d96bb
3 changed files with 20 additions and 264 deletions

View File

@ -29,53 +29,8 @@ Core poly2tri lib:
Testbed:
* gcc
* OpenGL
* [GLFW](http://glfw.sf.net)
* Python
[waf](http://code.google.com/p/waf/) is used to compile the testbed.
A waf script (86kb) is included in the repositoty.
Building the Testbed
--------------------
Posix/MSYS environment:
```
./waf configure
./waf build
```
Windows command line:
```
python waf configure
python waf build
```
Alternatively, the testbed can be built using cmake. See below.
Running the Examples
--------------------
Load data points from a file:
```
p2t <filename> <center_x> <center_y> <zoom>
```
Random distribution of points inside a constrained box:
```
p2t random <num_points> <box_radius> <zoom>
```
Examples:
```
./build/p2t testbed/data/dude.dat 300 500 2
./build/p2t testbed/data/nazca_monkey.dat 0 0 9
./build/p2t random 10 100 5.0
./build/p2t random 1000 20000 0.025
```
BUILD WITH CMAKE
================
Build the library
-----------------
@ -105,6 +60,26 @@ cmake -GNinja -DP2T_BUILD_TESTBED=ON
cmake --build .
```
Running the Examples
--------------------
Load data points from a file:
```
p2t <filename> <center_x> <center_y> <zoom>
```
Random distribution of points inside a constrained box:
```
p2t random <num_points> <box_radius> <zoom>
```
Examples:
```
./build/p2t testbed/data/dude.dat 300 500 2
./build/p2t testbed/data/nazca_monkey.dat 0 0 9
./build/p2t random 10 100 5.0
./build/p2t random 1000 20000 0.025
```
References
==========

173
waf vendored

File diff suppressed because one or more lines are too long

46
wscript
View File

@ -1,46 +0,0 @@
#!/usr/bin/env python
# encoding: utf-8
VERSION='0.3.3'
import sys
APPNAME='p2t'
top = '.'
out = 'build'
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']
from waflib.Tools.compiler_cxx import cxx_compiler
cxx_compiler['win32'] = ['g++']
#Platform specific libs
if sys.platform in ['win32', 'msys']:
# MS Windows
sys_libs = ['glfw3', 'opengl32']
elif sys.platform == 'darwin':
# Apple OSX
sys_libs = ['glfw']
else:
# GNU/Linux, BSD, etc
sys_libs = ['glfw', 'GL']
def options(opt):
print(' set_options')
opt.load('compiler_cxx')
def configure(conf):
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
if sys.platform == 'darwin':
conf.env.FRAMEWORK = ['OpenGL', 'Cocoa', 'IOKit']
def build(bld):
print(' building')
bld.program(features = 'cxx cxxprogram', source=CPP_SOURCES, target = 'p2t', uselib = 'P2T')