mirror of https://gitlab.com/ita1024/waf.git
Compare commits
252 Commits
waf-2.0.26
...
master
Author | SHA1 | Date |
---|---|---|
ita1024 | 788d397224 | |
ita1024 | caa7727568 | |
Federico Pellegrin | fc7b01e694 | |
Waf Project | 6253670a5e | |
ita1024 | ce2a9907d8 | |
Federico Pellegrin | 7e12df33df | |
Andrew Malachowski | e93f468355 | |
Waf Project | 91e8dcb5d0 | |
Waf Project | 8504c212ce | |
Waf Project | 8971304c36 | |
Waf Project | c816802d87 | |
ita1024 | 6595748b91 | |
Harald Klimach | b5a6e58934 | |
ita1024 | 7c0532a82d | |
Alibek Omarov | bba5047716 | |
Waf Project | 0c0f49ce6f | |
ita1024 | b2f89369fc | |
Alibek Omarov | b94ec720d9 | |
Waf Project | 0d2f819d1e | |
Waf Project | bdd70055df | |
Waf Project | b47fceb86a | |
Waf Project | 69049d83b8 | |
Waf Project | 8d2ad010f5 | |
Waf Project | 72db8e0240 | |
Waf Project | 2485ab46cd | |
Waf Project | 68f84f9084 | |
Waf Project | 43c5ae670a | |
Waf Project | 8a0ecaef5f | |
Waf Project | 967abf694c | |
Waf Project | 327471474f | |
Waf Project | 9ad45cb350 | |
Waf Project | 149102f11f | |
Waf Project | 4d0edd113a | |
Waf Project | 66a013ed28 | |
Waf Project | bd5c22d484 | |
Waf Project | a3fec9f0b3 | |
Waf Project | e0dcfae373 | |
Waf Project | a7d05142c5 | |
Waf Project | 76f416ca14 | |
Waf Project | 9f0773cfba | |
Waf Project | ec63a7dd38 | |
swaldhoer | 974d0589fd | |
Waf Project | 39413bedfd | |
Waf Project | aef2c6ef23 | |
Waf Project | 456bd879bc | |
Waf Project | 707b362685 | |
Alibek Omarov | 6e675dfc30 | |
Waf Project | d166646556 | |
Federico Pellegrin | a0b8f6a2a3 | |
Waf Project | 761ed9beda | |
Waf Project | ea1412b7e7 | |
ita1024 | 53ca5a71ed | |
Alibek Omarov | 611cd30114 | |
Wynn Wilkes | 84ba1e9da0 | |
Waf Project | 01b4c03a84 | |
Waf Project | 97a54d72da | |
Waf Project | 5122ef89f2 | |
Wynn Wilkes | 4a650f3455 | |
Michael Vincent | 20b04dd137 | |
Waf Project | 266a75a4ef | |
Björn Lindqvist | 18192437a0 | |
Waf Project | 37808b3de4 | |
Waf Project | d115501165 | |
Björn Lindqvist | 8b140fd541 | |
Waf Project | 49231ab9ff | |
Dan Church | 2689cc9518 | |
Waf Project | 50644394f6 | |
Björn Lindqvist | f0b2fb9816 | |
Waf Project | dc5602608e | |
Thomas Nagy | 270a2e09b6 | |
ita1024 | 218da8fe28 | |
Rafaël Kooi | 6c0a8c7c84 | |
Alibek Omarov | 2e8121f63f | |
ita1024 | 215de5f7d3 | |
Adam Barton | 67dcb2b7f6 | |
Thomas Nagy | d4f495bced | |
Alibek Omarov | d7da1547f7 | |
Thomas Nagy | ff0a8cec14 | |
Thomas Nagy | 99bdb12a60 | |
Thomas Nagy | 412c9e6b22 | |
Thomas Nagy | c24ef5f3e6 | |
Thomas Nagy | 69c95b5341 | |
Harald Klimach | 240555a979 | |
Thomas Nagy | e559bd08f2 | |
Thomas Nagy | 698888f149 | |
André Bauer | af9a1a249d | |
Andrew Malachowski | f69602d1df | |
Federico Pellegrin | fae5693f41 | |
Andrew Malachowski | 23c975064e | |
Federico Pellegrin | 78f49d44c8 | |
Thomas Nagy | 7b912a0439 | |
Thomas Nagy | 2a1eeba691 | |
Alibek Omarov | b91ef6a91b | |
David Kassa | b0ea8121e8 | |
Thomas Nagy | d7d5e9d2d6 | |
Thomas Nagy | 5c90204a96 | |
Thomas Nagy | 6b820ba879 | |
Miro Hrončok | b093e9eac7 | |
ita1024 | 5d56dff596 | |
Francescodario Cuzzocrea | 317e3e8579 | |
Mathieu Parent | 97302d9758 | |
Thomas Nagy | 00c3cd31b6 | |
Thomas Nagy | 02d906f69a | |
Federico Pellegrin | 41eb8ef35f | |
Thomas Nagy | 8dc07cc533 | |
Thomas Nagy | 8ca3cbd277 | |
Thomas Nagy | d27e0bd271 | |
Thomas Nagy | 2bbee630cc | |
Thomas Nagy | f3c09355ef | |
Federico Pellegrin | 910133a5b6 | |
ita1024 | 065496a619 | |
Morten V. Pedersen | 59a9b24cf8 | |
Federico Pellegrin | 9c5945d85a | |
Federico Pellegrin | 229bf15ab2 | |
Federico Giovanardi | 664513aa44 | |
Erik Parker | 45bc50e523 | |
Thomas Nagy | 9a60e7ed9e | |
Thomas Nagy | 95c2bc0702 | |
Thomas Nagy | 55d57d0b58 | |
Thomas Nagy | 747a339b7f | |
Thomas Nagy | 86b1f0def1 | |
Thomas Nagy | 2f248f78e2 | |
Thomas Nagy | 58b58fb0ee | |
Federico Pellegrin | 6ccfd6d704 | |
Michael Vincent | 22b72e167f | |
Michael Vincent | bf97987991 | |
Michael Vincent | 30508f53c2 | |
Michael Vincent | 615c32faef | |
Michael Vincent | e55b4b2375 | |
Thomas Nagy | 67793aa173 | |
Michael Vincent | ba44704dbf | |
Alibek Omarov | a82625297d | |
Erik Parker | a23b3f5e9b | |
Erik Parker | 68ff6f13b2 | |
Thomas Nagy | 28318c9cca | |
Thomas Nagy | bf5a825317 | |
Bootsma, James | ca3ca0591e | |
Thomas Nagy | ff8c1828aa | |
Thomas Nagy | b864388e12 | |
Thomas Nagy | da5769172b | |
Thomas Nagy | 0d0aa45d0b | |
Thomas Nagy | e0c16b3ada | |
Federico Pellegrin | a8469f49d8 | |
Federico Pellegrin | 236e6a7945 | |
Federico Pellegrin | d17780bc6b | |
Federico Pellegrin | 1d722360be | |
Thomas Nagy | a296b4119e | |
Federico Pellegrin | 54464f0a20 | |
ita1024 | 8a0850dd89 | |
Andrew Brodko | 5841a8571e | |
Thomas Nagy | 1e729ba345 | |
Thomas Nagy | a74d40a505 | |
Thomas Nagy | 6ed66ce90b | |
Thomas Nagy | 6a5753da93 | |
Thomas Nagy | b7c7ffccab | |
Thomas Nagy | 81bb79ab3d | |
Thomas Nagy | 3af7222fa0 | |
Thomas Nagy | 4219f0822c | |
Thomas Nagy | 4e61e3a563 | |
Federico Pellegrin | 5584d1e687 | |
Thomas Nagy | b41f13b3a0 | |
Federico Pellegrin | d1eb41f944 | |
Federico Pellegrin | 9cd8a801c7 | |
Thomas Nagy | 6f8828dc3a | |
Federico Pellegrin | 47d097d5a0 | |
Thomas Nagy | cc03657db7 | |
Thomas Nagy | 2b03690f02 | |
Thomas Nagy | e73e8d680a | |
Thomas Nagy | 3b41d92e3c | |
Dotan Cohen | 6fba8d3742 | |
Dotan Cohen | 2831c75093 | |
Thomas Nagy | ea509dd782 | |
Thomas Nagy | 025ba60ebf | |
ita1024 | ccfe1fc19c | |
3961583-RA-Kooi@users.noreply.gitlab.com | 1f92d020e7 | |
Thomas Nagy | 35b60bed61 | |
Thomas Nagy | 43ce688cdf | |
Thomas Nagy | a168e28ec8 | |
Thomas Nagy | f65d08f5d5 | |
Thomas Nagy | b41b1741d1 | |
Alibek Omarov | 260f6065b9 | |
Matt Selsky | 778c7ad74c | |
Thomas Nagy | e21aead3b3 | |
Thomas Nagy | 05198a8302 | |
Thomas Nagy | cd589cd86b | |
Andreu Montiel | 988542e500 | |
Johan Pauwels | cc11c1dec1 | |
Johan Pauwels | 668392f9fb | |
Johan Pauwels | f67f175c39 | |
Johan Pauwels | 84e71c9408 | |
Johan Pauwels | 495b7c0e04 | |
Federico Pellegrin | 0c843e5d40 | |
Thomas Nagy | 14b7d15a03 | |
Thomas Nagy | 6c99c7cb0b | |
Federico Pellegrin | 5ee61cfa91 | |
Michael Vincent | d3c0017d21 | |
Mathieu Courtois | 2a6817fa1c | |
Thomas Nagy | a910d07d55 | |
ita1024 | b599c8bb9d | |
Federico Pellegrin | 04e586b28a | |
Federico Pellegrin | ba9ddfbfcb | |
Mathieu Courtois | 186f627203 | |
Federico Pellegrin | 0c616901b4 | |
Thomas Nagy | 4f8099fbdc | |
swaldhoer | 93a0258996 | |
Thomas Nagy | 4bfab7f926 | |
swaldhoer | 02cff4a20c | |
Michael Vincent | b7549d33ed | |
Federico Pellegrin | 405c322489 | |
Federico Pellegrin | 0c855b0aa2 | |
Federico Pellegrin | c438138476 | |
Morten V. Pedersen | 3204e2597c | |
Morten V. Pedersen | 058b5d3793 | |
Thomas Nagy | ce2e5ca9a2 | |
Thomas Nagy | 13d9c8566c | |
Thomas Nagy | 07d3203e0b | |
Thomas Nagy | 35617abe5e | |
Thomas Nagy | 015a51a7cf | |
Thomas Nagy | 52a49960c1 | |
Adriano Scoditti | e3c275a96a | |
Thomas Nagy | bab51bf9f4 | |
Thomas Nagy | 5ec740ad2e | |
ita1024 | 73d432eb0a | |
Rafaël Kooi | c4f18f8182 | |
Rafaël Kooi | 273d9dbe73 | |
Rafaël Kooi | 32c2a49bf0 | |
Rafaël Kooi | 7310ade7c3 | |
Rafaël Kooi | 9fee4dfa75 | |
Severin Strobl | 799001bfae | |
Thomas Nagy | d97ac90419 | |
Thomas Nagy | b27afc7bbc | |
ita1024 | 11f449ee57 | |
Rafaël Kooi | 5343e8547a | |
Thomas Nagy | 394f3cdac8 | |
Thomas Nagy | 16dbeb73e8 | |
Thomas Nagy | 38b6f24d73 | |
Thomas Nagy | e485b45472 | |
Federico Pellegrin | 26309403fd | |
Alibek Omarov | 261a589a66 | |
Federico Pellegrin | 64b74c7659 | |
Thomas Nagy | 142fe5016a | |
Thomas Nagy | 4e171c87ad | |
Thomas Nagy | b8f19bfea3 | |
Thomas Nagy | a6ff2fc274 | |
Thomas Nagy | 6ef3a95c48 | |
Rafaël Kooi | dbc66d19ba | |
Thomas Nagy | f93cd67b14 | |
Thomas Nagy | 4aaadc1320 | |
Thomas Nagy | 5041a862fb | |
Thomas Nagy | dbe338c246 | |
Thomas Nagy | 959d57b757 | |
Thomas Nagy | 1068ff98ec |
|
@ -8,7 +8,9 @@ build
|
||||||
demos/*/build*
|
demos/*/build*
|
||||||
playground/*/build*
|
playground/*/build*
|
||||||
.waf-*
|
.waf-*
|
||||||
|
waf-*
|
||||||
.waf3-*
|
.waf3-*
|
||||||
|
waf3-*
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
|
@ -37,3 +39,9 @@ Temporary Items
|
||||||
|
|
||||||
# Windows build output
|
# Windows build output
|
||||||
waf.bat
|
waf.bat
|
||||||
|
|
||||||
|
# Vim temporary files
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# YouCompleteMe configuration
|
||||||
|
.ycm_extra_conf.py
|
||||||
|
|
|
@ -9,7 +9,8 @@ pipeline {
|
||||||
label "ubuntu"
|
label "ubuntu"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'python2.7 ./waf-light'
|
sh 'python3 ./waf-light'
|
||||||
|
sh 'python2.7 ./waf --help'
|
||||||
stash includes: 'waf', name: 'waf'
|
stash includes: 'waf', name: 'waf'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,31 +156,14 @@ cd tests/install_group/
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
export WAF_NO_PREFORK=1
|
export WAF_NO_PREFORK=1
|
||||||
/home/jenkins/jython/bin/jython ./waf-light
|
python3 ./waf-light
|
||||||
cp waf demos/c
|
cp waf demos/c
|
||||||
cd demos/c
|
cd demos/c
|
||||||
/home/jenkins/jython/bin/jython ./waf distclean configure clean build
|
/home/jenkins/jython/bin/jython ./waf distclean configure clean build
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('py27') {
|
stage('py38') {
|
||||||
agent {
|
|
||||||
label "openbsd"
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
dir('demos') {
|
|
||||||
unstash 'waf'
|
|
||||||
}
|
|
||||||
sh '''cd demos/asm; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/c; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/c++; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/glib2; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/perl; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/python; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
sh '''cd demos/subst; /usr/local/bin/python2.7 ../waf configure clean build'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('py36') {
|
|
||||||
agent {
|
agent {
|
||||||
label "openbsd"
|
label "openbsd"
|
||||||
}
|
}
|
||||||
|
@ -261,28 +245,6 @@ cd tests/install_group/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('OpenIndiana') {
|
|
||||||
stages {
|
|
||||||
stage('py27') {
|
|
||||||
agent {
|
|
||||||
label "openindiana"
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
dir('demos') {
|
|
||||||
unstash 'waf'
|
|
||||||
}
|
|
||||||
sh '''export CFLAGS='-std=c99 -D_STDC_C99' '''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=c'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=c++'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=dbus'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=java'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=perl'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=python'''
|
|
||||||
sh '''cd demos; ./waf configure clean build --top=ruby'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('FreeBSD') {
|
stage('FreeBSD') {
|
||||||
stages {
|
stages {
|
||||||
stage('py36') {
|
stage('py36') {
|
||||||
|
|
201
ChangeLog
201
ChangeLog
|
@ -1,169 +1,30 @@
|
||||||
NEW IN WAF 2.0.19
|
NEW IN WAF 2.1.2
|
||||||
-----------------
|
|
||||||
* Fix negative values for -j #2256
|
|
||||||
* Fix the Swig example compatibility with Python3 #2259
|
|
||||||
* Add extras/wafcache
|
|
||||||
* Tune the application name on --help #2254
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.18
|
|
||||||
-----------------
|
|
||||||
* Fix a deadlock with cython and subst tasks #2244
|
|
||||||
* Fix rpath processing so that it no longer breaks dependency chains
|
|
||||||
* Fix fast_partial.py failures on configuration tests
|
|
||||||
* Fix duplicate -fno-strict-aliasing flags in Python compilation flags detection
|
|
||||||
* Fix annoying PIE errors in demos/asm/
|
|
||||||
* Improve configuration tests cache accuracy #2251
|
|
||||||
* Improve extras/fast_partial.py compatibility
|
|
||||||
* Improve extras/doxygen.py outdir parameter settings #2255
|
|
||||||
* Add a dependency scanner for assembly files (Gas/Yasm)
|
|
||||||
* Add executable arguments for configuration tests / execute=True
|
|
||||||
* Add a QtTest example to demos/qt5/ #2241
|
|
||||||
* Add a cross-compilation option to extras/objcopy.py #2247
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.17
|
|
||||||
-----------------
|
|
||||||
* Improve build performance on FreeBSD and Python3 #2241
|
|
||||||
* Add Python 3.8 flag detection for building embedded interpreters #2239
|
|
||||||
* Prevent Qt5 uninstallation errors when c++ files are generated
|
|
||||||
* Improve installation/uninstallation colors
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.16
|
|
||||||
-----------------
|
|
||||||
* Fix task semaphore errors on stateful tasks #2232
|
|
||||||
* Fix encoding errors with UTF-8 paths on Python 2 #2230
|
|
||||||
* Fix encoding errors in waf_unit_test #2220
|
|
||||||
* Improve dependency between javac task and use-d generated jars nodes
|
|
||||||
* Install pdb files with /debug:* flags #2224
|
|
||||||
* Make javadoc detection optional #2225
|
|
||||||
* Improve md5_tstamp documentation #2221
|
|
||||||
* Add extras/color_msvc to colorizes MSVC outputs #2221
|
|
||||||
* Fix symbol regex on mac-o binaries in extras/syms #2222
|
|
||||||
* Maintain order of lines in doxyfile in extras/doxygen #2223
|
|
||||||
* Improve extras/msvcdeps path handling
|
|
||||||
* Add extras/clang_cross for cross-compilation using clang
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.15
|
|
||||||
-----------------
|
|
||||||
* Fix Python path detection under Git-Bash #2217
|
|
||||||
* Provide an option to disable args files #2216
|
|
||||||
* Improve command line length calculation for args files #2214
|
|
||||||
* Add libs/stubs to Cuda library path #2213
|
|
||||||
* Suppress ant_glob java warnings #2212
|
|
||||||
* Support multiple 'default_cmd' #2211
|
|
||||||
* Warn when buildcopy is used without any files to copy #2210
|
|
||||||
* Protobuf examples enhancements #2208 #2209
|
|
||||||
* Fix all DeprecationWarning: invalid escape sequence #2207
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.14
|
|
||||||
-----------------
|
|
||||||
* Support Fortran 2008 submodules #2205
|
|
||||||
* Possible solution for Msys/Python 3.6 path issues #2217
|
|
||||||
* Support NEC SX-Aurora TSUBASA system's Fortran compiler extras/fc_nfort.py #2206
|
|
||||||
* Fix ignored configuration flags in gccdeps extras/gccdeps.py #2203
|
|
||||||
* Fix included protoc search on nested wscripts extras/protoc.py #2202
|
|
||||||
* Support extra taskgen and out of project include directories extras/protoc.py #2204
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.13
|
|
||||||
-----------------
|
|
||||||
* Fix "broken revdeps" extra error message on certain build failures
|
|
||||||
* Avoid duplicate flags in Python configuration tests
|
|
||||||
* Find more Swig dependencies #2206
|
|
||||||
* Avoid spawning threads with -j1 on AIX systems
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.12
|
|
||||||
-----------------
|
|
||||||
* Fix broken inheritance task trees #2194
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.11
|
|
||||||
-----------------
|
|
||||||
* Do not raise an exception on check_cfg/mandatory=False/-vv #2193
|
|
||||||
* Post past task generators in lazy sub-folder builds #2191
|
|
||||||
* Disable warnings on versioned library installation
|
|
||||||
* Fix cpplint concurrent execution problems
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.10
|
|
||||||
-----------------
|
|
||||||
* Add a task semaphore system
|
|
||||||
* Fix --help when no wscript is supplied #2184
|
|
||||||
* Fix Fortran processing with generated Fortran files
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.9
|
|
||||||
----------------
|
----------------
|
||||||
* Add dependencies on scriptlet outputs
|
* Work around some Python regressions
|
||||||
* Made options optional for cython waftool
|
* Add latex dependeny on environment variables
|
||||||
* Improve doxygen error handling
|
* Add support for flang compiler
|
||||||
|
|
||||||
NEW IN WAF 2.0.8
|
NEW IN WAF 2.1.1
|
||||||
----------------
|
----------------
|
||||||
* Improve Windows console encoding outputs on Python 3.6 and Japanese code page #2163
|
* Fixed some argparse regressions
|
||||||
* Improve msvc detection on Python 3.6 and Japanese code page #2155
|
* Fixed 'waf --version'
|
||||||
* Improve moc/rcc flag parsing with msvc #2169
|
* Updated most project examples
|
||||||
* Improve Eclipse project generation #2166 #2165 #2164 #2149 #2145
|
|
||||||
* Improve Boost project detection on dpkg-based systems #2146
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.7
|
CHANGES IN WAF 2.1.0
|
||||||
----------------
|
--------------------
|
||||||
* Apply priorities to dynamically-generated tasks #2137
|
* While the Waf file runs on Python 2 and 3, creating it requires Python 3
|
||||||
* Fix upcoming Python 3.7 incompatibilities #2126
|
+ Added wafcache
|
||||||
* Fix Python3 support in extras/xcode6.py #2121
|
+ waf_unit_test: Added task in returned tuples, custom reports should be adapted
|
||||||
* Improve priority support in extras/swig.py #2137
|
~ Ensure ConfigurationContext.load and Context.load definitions are consistent and remove unused *k parameters
|
||||||
* Improve support extras/protoc.py #2135
|
~ Remove the dependency on optparse and use argparse instead
|
||||||
* Improve argument handling in extras/clang_compilation_database.py #2127
|
- Remove waflib.Runner.PriorityTasks.appendleft
|
||||||
* Add glib DBus bindings in extras/gdbus.py #2134
|
- Remove waflib.Task.TaskBase
|
||||||
* Avoid name collisions for precompiled headers and libraries with similar names in extras/pch.py #2122
|
- Remove the upper class of waflib.Task.Task (metaclass syntax)
|
||||||
|
- Remove Winphone/WinCE detection in msvc.py
|
||||||
|
- Remove conf.add_as_needed because it does not check for the flag usage
|
||||||
|
|
||||||
NEW IN WAF 2.0.6
|
CHANGES IN WAF 2.0.0
|
||||||
----------------
|
--------------------
|
||||||
* Add Task.deep_inputs to enable further dependencies on input file tasks
|
|
||||||
* Set unit tests to depend on input file tasks instead of timestamps
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.5
|
|
||||||
----------------
|
|
||||||
* Force unit tests to depend on the executable creation time besides file contents
|
|
||||||
* Enhance the Eclipse project generator
|
|
||||||
* Update the cuda examples
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.4
|
|
||||||
----------------
|
|
||||||
* Enable more advanced warnings of ant_glob on build folders in verbose mode
|
|
||||||
* Defer node.ant_glob(..., generator=True) evaluation
|
|
||||||
* Enable 'waf clean' to get the list of files to remove from bld.clean_files
|
|
||||||
* Define the environment variable WAF_NO_PREFORK to skip pre-forking
|
|
||||||
* Fix Can't pickle local object '_createenviron.<locals>.encode' exceptions (Python 3.6)
|
|
||||||
* Improve the Erlang module #2095
|
|
||||||
* Add task target to parallel_debug outputs #2091
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.3
|
|
||||||
----------------
|
|
||||||
* Enable install_path=None for Python targets #2087
|
|
||||||
* Skip empty or duplicates in java user classpath #2084
|
|
||||||
* Change the unit test summary color scheme to use green and red colors
|
|
||||||
* Improve the deadlock error message
|
|
||||||
* Report sys.path values from Context.load_tool to improve error messages
|
|
||||||
* Cache qrc uic->h conversions to enable qrc re-use across targets
|
|
||||||
* Output long-running tasks outputs immediately using bld(rule=..., stdout=None)
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.2
|
|
||||||
----------------
|
|
||||||
* Improve Intel Fortran compiler detection on Windows #2063
|
|
||||||
* Ensure that the task count starts at 1 in the build outputs
|
|
||||||
* Add a --pdb option to start pdb on unexpected exceptions #2052
|
|
||||||
* Fix conflicting qm/qrc re-used output files for multiple targets #2065
|
|
||||||
* Add java support in protobuf (extras) #2049
|
|
||||||
* Add a java test example (extras) #2062
|
|
||||||
* Enable symbol processing for empty targets (extras) #2053
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.1
|
|
||||||
----------------
|
|
||||||
* Improve the default preprocessor behaviour for gcc/msvc
|
|
||||||
* Accept task objects in Build.add_to_group for compatibility reasons
|
|
||||||
* Prevent xcode generator from overwriting existing features #2038
|
|
||||||
* Fix self.includes data scope #2035
|
|
||||||
* Fix Node.ant_glob case sensitivity regression #2034
|
|
||||||
* Fix Logs.verbose options regression #2033
|
|
||||||
|
|
||||||
NEW IN WAF 2.0.0
|
|
||||||
----------------
|
|
||||||
* Provide a new priority system to improve scalability on complex builds
|
* Provide a new priority system to improve scalability on complex builds
|
||||||
* Provide TaskGroup objects to improve scalability on complex builds
|
* Provide TaskGroup objects to improve scalability on complex builds
|
||||||
* Force new files into the build directory by default (use Node objects to bypass)
|
* Force new files into the build directory by default (use Node objects to bypass)
|
||||||
|
@ -174,12 +35,12 @@ NEW IN WAF 2.0.0
|
||||||
* Accept nested lists and generators in bld(source=...)
|
* Accept nested lists and generators in bld(source=...)
|
||||||
* Sort TaskGen methods in alphabetical order by reversing TaskGen.prec order
|
* Sort TaskGen methods in alphabetical order by reversing TaskGen.prec order
|
||||||
|
|
||||||
* Remove 'ut_fun' from waf_unit_test.py
|
- Remove 'ut_fun' from waf_unit_test.py
|
||||||
* Remove Node.sig and Node.cache_sig
|
- Remove Node.sig and Node.cache_sig
|
||||||
* Remove the BuildContext.rule decorator
|
- Remove the BuildContext.rule decorator
|
||||||
* Remove Task.update_outputs, Task.always_run
|
- Remove Task.update_outputs, Task.always_run
|
||||||
* Remove atleast-version, exact-version and max-version from conf.check_cfg
|
- Remove atleast-version, exact-version and max-version from conf.check_cfg
|
||||||
* Remove c_preproc.trimquotes
|
- Remove c_preproc.trimquotes
|
||||||
* Remove field_name, type_name, function_name from conf.check() tests
|
- Remove field_name, type_name, function_name from conf.check() tests
|
||||||
* Remove extras/mem_reducer.py as a better solution has been merged
|
- Remove extras/mem_reducer.py as a better solution has been merged
|
||||||
* Remove Utils.ex_stack (use traceback.format_exc())
|
- Remove Utils.ex_stack (use traceback.format_exc())
|
||||||
|
|
1
DEVEL
1
DEVEL
|
@ -38,4 +38,3 @@ or in playground/ for modules under waflib/extras.
|
||||||
|
|
||||||
The files under waflib/Tools/ are kept API-compatible for the duration
|
The files under waflib/Tools/ are kept API-compatible for the duration
|
||||||
of a middle version (currently 2.0).
|
of a middle version (currently 2.0).
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. The name of the author may not be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
||||||
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||||
|
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
|
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
43
README.md
43
README.md
|
@ -1,32 +1,24 @@
|
||||||
## ABOUT WAF
|
# ABOUT WAF
|
||||||
|
|
||||||
Waf is a Python-based framework for configuring, compiling and installing applications. Here are perhaps the most important features of Waf:
|
Waf is a Python-based framework for configuring, compiling and installing applications. Here are perhaps the most important features of Waf:
|
||||||
|
|
||||||
* *Automatic build order*: the build order is computed from input and output files, among others
|
* *Automatic build order*: the build order is computed from input and output files, among others
|
||||||
* *Automatic dependencies*: tasks to execute are detected by hashing files and commands
|
* *Automatic dependencies*: tasks to execute are detected by hashing files and commands
|
||||||
* *Performance*: tasks are executed in parallel automatically, the startup time is meant to be fast (separation between configuration and build)
|
* *Performance*: tasks are executed in parallel automatically, the startup time is meant to be fast (separation between configuration and build)
|
||||||
* *Flexibility*: new commands and tasks can be added very easily through subclassing, bottlenecks for specific builds can be eliminated through dynamic method replacement
|
* *Flexibility*: new commands and tasks can be added very easily through subclassing, bottlenecks for specific builds can be eliminated through dynamic method replacement
|
||||||
* *Extensibility*: though many programming languages and compilers are already supported by default, many others are available as extensions
|
* *Extensibility*: though many programming languages and compilers are already supported by default, many others are available as extensions
|
||||||
* *IDE support*: Eclipse, Visual Studio and Xcode project generators (`waflib/extras/`)
|
* *IDE support*: Eclipse, Visual Studio and Xcode project generators (`waflib/extras/`)
|
||||||
* *Documentation*: the application is based on a robust model documented in [The Waf Book](https://waf.io/book/) and in the [API docs](https://waf.io/apidocs/)
|
* *Documentation*: the application is based on a robust model documented in [The Waf Book](https://waf.io/book/) and in the [API docs](https://waf.io/apidocs/)
|
||||||
* *Python compatibility*: cPython 2.5 to 3.x, Jython 2.5, IronPython, and Pypy
|
* *Python compatibility*: cPython 2.7 to 3.x, Jython 2.7 and PyPy
|
||||||
|
|
||||||
Waf is used in particular by innovative companies such as [Avalanche Studios](http://www.avalanchestudios.se) and by open-source projects such as [RTEMS](https://www.rtems.org/). Learn more about Waf by reading [The Waf Book](https://waf.io/book/).
|
Learn more about Waf by reading [The Waf Book](https://waf.io/book/). For researchers and build system writers, Waf also provides a framework and examples for creating [custom build systems](https://gitlab.com/ita1024/waf/tree/master/build_system_kit) and [package distribution systems](https://gitlab.com/ita1024/waf/blob/master/playground/distnet/README.rst).
|
||||||
|
|
||||||
For researchers and build system writers, Waf also provides a framework for creating [custom build systems](https://gitlab.com/ita1024/waf/tree/master/build_system_kit) and [package distribution systems](https://gitlab.com/ita1024/waf/blob/master/playground/distnet/README.rst).
|
Download the project from our page on [waf.io](https://waf.io/), consult the [manual](https://waf.io/book/), the [API documentation](https://waf.io/apidocs/) and the [showcases](https://gitlab.com/ita1024/waf/tree/master/demos) and [experiments](https://gitlab.com/ita1024/waf/tree/master/playground).
|
||||||
|
|
||||||
Download the project from our page on [waf.io](https://waf.io/) or from a mirror on [freehackers.org](http://www.freehackers.org/~tnagy/release/), consult the [manual](https://waf.io/book/), the [API documentation](https://waf.io/apidocs/) and the [showcases](https://gitlab.com/ita1024/waf/tree/master/demos) and [experiments](https://gitlab.com/ita1024/waf/tree/master/playground).
|
|
||||||
|
|
||||||
## HOW TO CREATE THE WAF SCRIPT
|
## HOW TO CREATE THE WAF SCRIPT
|
||||||
|
|
||||||
Python >= 2.6 is required to generate the waf script, and the resulting file can then run on Python 2.5.
|
|
||||||
Just run:
|
|
||||||
```sh
|
```sh
|
||||||
$ python ./waf-light configure build
|
python ./waf-light configure build
|
||||||
```
|
|
||||||
Or, if several python versions are installed:
|
|
||||||
```sh
|
|
||||||
$ python3 ./waf-light configure build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## CUSTOMIZATION
|
## CUSTOMIZATION
|
||||||
|
@ -34,20 +26,23 @@ $ python3 ./waf-light configure build
|
||||||
The Waf tools in waflib/extras are not added to the waf script. To add
|
The Waf tools in waflib/extras are not added to the waf script. To add
|
||||||
some of them, use the --tools switch. An absolute path can be passed
|
some of them, use the --tools switch. An absolute path can be passed
|
||||||
if the module does not exist under the 'extras' folder:
|
if the module does not exist under the 'extras' folder:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ./waf-light --tools=swig
|
./waf-light --tools=swig
|
||||||
```
|
```
|
||||||
|
|
||||||
To customize the initialization, pass the parameter 'prelude'. Here is for example
|
To customize the initialization, pass the parameter 'prelude'. Here is for example
|
||||||
how to create a waf file using the compat15 module:
|
how to create a waf file using the compat15 module:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ./waf-light --tools=compat15 --prelude=$'\tfrom waflib.extras import compat15\n'
|
./waf-light --tools=compat15 --prelude=$'\tfrom waflib.extras import compat15\n'
|
||||||
```
|
```
|
||||||
|
|
||||||
Although any kind of initialization is possible, using the build system kit
|
Although any kind of initialization is possible, using the build system kit
|
||||||
may be easier (folder build\_system\_kit):
|
may be easier (folder build\_system\_kit):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ./waf-light --make-waf --tools=compat15,/comp/waf/aba.py --prelude=$'\tfrom waflib.extras import compat15\n\tprint("ok")'
|
./waf-light --make-waf --tools=compat15,/comp/waf/aba.py --prelude=$'\tfrom waflib.extras import compat15\n\tprint("ok")'
|
||||||
```
|
```
|
||||||
|
|
||||||
To avoid regenerating the waf file all the time, just set the `WAFDIR` environment variable to the directory containing "waflib".
|
To avoid regenerating the waf file all the time, just set the `WAFDIR` environment variable to the directory containing "waflib".
|
||||||
|
@ -55,9 +50,9 @@ To avoid regenerating the waf file all the time, just set the `WAFDIR` environme
|
||||||
## HOW TO RUN THE EXAMPLES
|
## HOW TO RUN THE EXAMPLES
|
||||||
|
|
||||||
Try this:
|
Try this:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cp waf demos/c/
|
cp waf demos/c/
|
||||||
cd demos/c/
|
cd demos/c/
|
||||||
./waf configure build
|
./waf configure build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
12
TODO
12
TODO
|
@ -1,12 +0,0 @@
|
||||||
Waf 2.1
|
|
||||||
-------
|
|
||||||
|
|
||||||
- Remove Winphone/WinCE detection in msvc.py
|
|
||||||
- Fix the circular imports ccroot<->c_config.py
|
|
||||||
- Remove superfluous *k in ctx.load() and other unused parameters
|
|
||||||
Ensure conf.load() has the same interface as ctx.load()
|
|
||||||
- Remove waflib.Runner.PriorityTasks.appendleft
|
|
||||||
- Remove waflib.Task.TaskBase
|
|
||||||
- Remove the upper class of waflib.Task.Task (metaclasses)
|
|
||||||
- Ordered_iter_dict in python 3.7
|
|
||||||
- Change _add_task to add_task in Runner.py
|
|
|
@ -1,16 +1,16 @@
|
||||||
#include "header.h"
|
#include "header.h"
|
||||||
|
|
||||||
.text
|
.data
|
||||||
.align 2
|
|
||||||
|
|
||||||
.section .data
|
|
||||||
|
|
||||||
val:
|
val:
|
||||||
.long SOME_VALUE
|
.long SOME_VALUE
|
||||||
|
|
||||||
|
.text
|
||||||
|
.align 2
|
||||||
|
|
||||||
// Multiply input value by 421...
|
// Multiply input value by 421...
|
||||||
.global mult10
|
.global mult10
|
||||||
.type mult10, function
|
.type mult10, @function
|
||||||
mult10:
|
mult10:
|
||||||
pushq %rbp
|
pushq %rbp
|
||||||
movq %rsp,%rbp
|
movq %rsp,%rbp
|
||||||
|
@ -20,4 +20,3 @@ mult10:
|
||||||
|
|
||||||
popq %rbp
|
popq %rbp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ def build(bld):
|
||||||
target = 'asmtest',
|
target = 'asmtest',
|
||||||
defines = 'foo=12',
|
defines = 'foo=12',
|
||||||
asflags = '-Os',
|
asflags = '-Os',
|
||||||
includes = '.')
|
includes = '.',
|
||||||
|
linkflags = '-no-pie')
|
||||||
|
|
||||||
def disp(ctx):
|
def disp(ctx):
|
||||||
node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0]
|
node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0]
|
||||||
ctx.exec_command('%s' % node.abspath(), shell=False)
|
ctx.exec_command('%s' % node.abspath(), shell=False)
|
||||||
bld.add_post_fun(disp)
|
bld.add_post_fun(disp)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<node name="/org/freedesktop/DBus/Properties">
|
|
||||||
<interface name="org.freedesktop.DBus.Properties">
|
|
||||||
<method name="Set">
|
|
||||||
<arg type="s" name="interface_name"/>
|
|
||||||
<arg type="s" name="property_name"/>
|
|
||||||
<arg type="v" name="value"/>
|
|
||||||
</method>
|
|
||||||
</interface>
|
|
||||||
</node>
|
|
|
@ -1,21 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2010 (ita)
|
|
||||||
|
|
||||||
VERSION = '1.0'
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
opt.load('compiler_c')
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.load('compiler_c dbus')
|
|
||||||
conf.find_program('glib-genmarshal') # required on a few systems
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
tg = bld.program(
|
|
||||||
includes = '.',
|
|
||||||
source = bld.path.ant_glob('*.c'),
|
|
||||||
target = 'gnome-hello')
|
|
||||||
|
|
||||||
tg.add_dbus_file('test.xml', 'test_prefix', 'glib-server')
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ def build(bld):
|
||||||
|
|
||||||
# javac
|
# javac
|
||||||
srcdir = 'src',
|
srcdir = 'src',
|
||||||
compat = '1.7',
|
compat = '8',
|
||||||
|
|
||||||
# jar
|
# jar
|
||||||
basedir = '.',
|
basedir = '.',
|
||||||
|
|
|
@ -4,7 +4,7 @@ def build(bld):
|
||||||
|
|
||||||
bld(features = 'javac',
|
bld(features = 'javac',
|
||||||
srcdir = 'src',
|
srcdir = 'src',
|
||||||
compat = '1.7',
|
compat = '8',
|
||||||
use = 'cats-src',
|
use = 'cats-src',
|
||||||
name = 'bengala-cat',
|
name = 'bengala-cat',
|
||||||
recurse_use = True,
|
recurse_use = True,
|
||||||
|
|
|
@ -4,7 +4,7 @@ def build(bld):
|
||||||
|
|
||||||
bld(features = 'javac',
|
bld(features = 'javac',
|
||||||
srcdir = 'src',
|
srcdir = 'src',
|
||||||
compat = '1.7',
|
compat = '8',
|
||||||
use = 'animals',
|
use = 'animals',
|
||||||
name = 'cats-src',
|
name = 'cats-src',
|
||||||
)
|
)
|
||||||
|
|
|
@ -36,7 +36,7 @@ def build(bld):
|
||||||
bld(features = 'javac jar javadoc',
|
bld(features = 'javac jar javadoc',
|
||||||
srcdir = 'src/', # folder containing the sources to compile
|
srcdir = 'src/', # folder containing the sources to compile
|
||||||
outdir = 'src', # folder where to output the classes (in the build directory)
|
outdir = 'src', # folder where to output the classes (in the build directory)
|
||||||
compat = '1.6', # java compatibility version number
|
compat = '8', # java compatibility version number
|
||||||
sourcepath = ['src', 'sup'],
|
sourcepath = ['src', 'sup'],
|
||||||
classpath = ['.', '..'],
|
classpath = ['.', '..'],
|
||||||
#jaropts = ['-C', 'default/src/', '.'], # can be used to give files
|
#jaropts = ['-C', 'default/src/', '.'], # can be used to give files
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_StringUtils_isAlpha(JNIEnv *env, jclass clazz,
|
JNIEXPORT jboolean JNICALL Java_StringUtils_isAlpha(JNIEnv *env, jclass clazz,
|
||||||
jstring jStr)
|
jstring jStr)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// waf sample Mac application - main.m
|
// waf sample Mac application - main.m
|
||||||
// Chris Pickel, 2011
|
// Chris Pickel, 2011
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
int main(int argc, const char* argv[]) {
|
int main(int argc, const char* argv[]) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ def configure(conf):
|
||||||
if not conf.env.ARCH_ST:
|
if not conf.env.ARCH_ST:
|
||||||
conf.fatal('This example is for macs only')
|
conf.fatal('This example is for macs only')
|
||||||
conf.env.FRAMEWORK_COCOA = 'Cocoa'
|
conf.env.FRAMEWORK_COCOA = 'Cocoa'
|
||||||
conf.env.ARCH_COCOA = ['i386', 'x86_64']
|
conf.env.ARCH_COCOA = ['x86_64', 'arm64']
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
bld.program(
|
bld.program(
|
||||||
|
|
|
@ -35,4 +35,3 @@ Bar_private::Bar_private() : QWidget(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "foo.moc"
|
#include "foo.moc"
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@ def configure(conf):
|
||||||
conf.load('compiler_cxx qt5 waf_unit_test')
|
conf.load('compiler_cxx qt5 waf_unit_test')
|
||||||
#conf.env.append_value('CXXFLAGS', ['-g']) # test
|
#conf.env.append_value('CXXFLAGS', ['-g']) # test
|
||||||
|
|
||||||
|
if not conf.env.QT_LRELEASE:
|
||||||
|
# While qt5 detects most Qt tools, most of them are optional
|
||||||
|
conf.fatal('lrelease was not found')
|
||||||
|
|
||||||
# These tests would run on Ubuntu but not on other platforms
|
# These tests would run on Ubuntu but not on other platforms
|
||||||
conf.check(
|
conf.check(
|
||||||
define_name = 'XYZ_QT5_TESTS',
|
define_name = 'XYZ_QT5_TESTS',
|
||||||
|
@ -78,7 +82,7 @@ def print_test_results(bld):
|
||||||
lst = getattr(bld, 'utest_results', [])
|
lst = getattr(bld, 'utest_results', [])
|
||||||
if not lst:
|
if not lst:
|
||||||
return
|
return
|
||||||
for (f, code, out, err) in lst:
|
for result in lst:
|
||||||
print(out.decode('utf-8'))
|
print(result.out.decode('utf-8'))
|
||||||
print(err.decode('utf-8'))
|
print(result.err.decode('utf-8'))
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
\maketitle
|
\maketitle
|
||||||
\tableofcontents
|
\tableofcontents
|
||||||
|
|
||||||
\glossarystyle{altlist}
|
% next line is broken after using a newer texlive version
|
||||||
|
%\glossarystyle{altlist}
|
||||||
|
|
||||||
%% The glossary entries
|
%% The glossary entries
|
||||||
\newglossaryentry{african}
|
\newglossaryentry{african}
|
||||||
|
|
|
@ -17,7 +17,7 @@ def build(bld):
|
||||||
|
|
||||||
# optional parameters
|
# optional parameters
|
||||||
obj.outs = 'ps' # we want a postscript output too - 'ps pdf' works too
|
obj.outs = 'ps' # we want a postscript output too - 'ps pdf' works too
|
||||||
obj.prompt = 1 # put 0 for the batchmode (conceals the debug output)
|
obj.prompt = 1 # put 0 for the nonstopmode (conceals the debug output)
|
||||||
obj.deps = 'wscript crossreferencing.ltx' # use this to give dependencies directly
|
obj.deps = 'wscript crossreferencing.ltx' # use this to give dependencies directly
|
||||||
|
|
||||||
# or more simply, for a pdf..
|
# or more simply, for a pdf..
|
||||||
|
|
|
@ -7,6 +7,7 @@ bld(
|
||||||
source = 'HelloWorldTest.cpp',
|
source = 'HelloWorldTest.cpp',
|
||||||
target = 'unit_test_program',
|
target = 'unit_test_program',
|
||||||
use = 'unittestmain useless CPPUNIT',
|
use = 'unittestmain useless CPPUNIT',
|
||||||
ut_str = '${SRC[0].abspath()} -flag1 ${NARG}'
|
ut_str = '${SRC[0].abspath()} -flag1 ${NARG}',
|
||||||
|
name = 'test0',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,6 @@ bld(
|
||||||
target = 'unit_test_program',
|
target = 'unit_test_program',
|
||||||
use = 'unittestmain useless CPPUNIT',
|
use = 'unittestmain useless CPPUNIT',
|
||||||
ut_cwd = bld.path,
|
ut_cwd = bld.path,
|
||||||
|
name = 'test1',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ if bld.env['PYTHON']:
|
||||||
bld(
|
bld(
|
||||||
features = 'test_scripts',
|
features = 'test_scripts',
|
||||||
test_scripts_source = 'test.py',
|
test_scripts_source = 'test.py',
|
||||||
test_scripts_template = '${PYTHON} ${SCRIPT}'
|
test_scripts_template = '${PYTHON} ${SCRIPT}',
|
||||||
|
name = 'test2',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ if bld.env['PYTHON']:
|
||||||
features = 'test_scripts',
|
features = 'test_scripts',
|
||||||
test_scripts_source = 'test.1.py test.2.py',
|
test_scripts_source = 'test.1.py test.2.py',
|
||||||
test_scripts_template = '${PYTHON} ${SCRIPT}',
|
test_scripts_template = '${PYTHON} ${SCRIPT}',
|
||||||
test_scripts_paths = paths
|
test_scripts_paths = paths,
|
||||||
|
name = 'test3',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,16 @@ def summary(bld):
|
||||||
Logs.pprint('CYAN', 'test report %3.0f%% success' % val)
|
Logs.pprint('CYAN', 'test report %3.0f%% success' % val)
|
||||||
|
|
||||||
Logs.pprint('CYAN', ' tests that fail %d/%d' % (tfail, total))
|
Logs.pprint('CYAN', ' tests that fail %d/%d' % (tfail, total))
|
||||||
for (f, code, out, err) in lst:
|
for result in lst:
|
||||||
if code:
|
if result.exit_code:
|
||||||
Logs.pprint('CYAN', ' %s' % f)
|
# In ut_task we have the task running the test and we can get any extra information
|
||||||
Logs.pprint('RED', 'status: %r' % code)
|
# from there (in this example just the generator name)
|
||||||
if out: Logs.pprint('RED', 'out: %r' % out)
|
Logs.pprint('CYAN', ' %s (%s)' % (result.test_path, result.generator.name))
|
||||||
if err: Logs.pprint('RED', 'err: %r' % err)
|
Logs.pprint('RED', 'status: %r' % result.exit_code)
|
||||||
|
if result.out:
|
||||||
|
Logs.pprint('RED', 'out: %r' % result.out)
|
||||||
|
if result.err:
|
||||||
|
Logs.pprint('RED', 'err: %r' % result.err)
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
bld.recurse('src tests')
|
bld.recurse('src tests')
|
||||||
|
|
|
@ -45,7 +45,7 @@ def build(bld):
|
||||||
#
|
#
|
||||||
# the config set 'debug' is loaded automatically when the 'debug' variant is used
|
# the config set 'debug' is loaded automatically when the 'debug' variant is used
|
||||||
if not bld.variant:
|
if not bld.variant:
|
||||||
bld.fatal('Call "waf build_debug" or "waf build_release", and read the comments in the wscript file!')
|
bld.fatal('Call "waf build_debug" or "waf build_release" (same with "clean_debug") and read the comments in the wscript file!')
|
||||||
|
|
||||||
# the includes='.' add the build directory path to the command arguments
|
# the includes='.' add the build directory path to the command arguments
|
||||||
# (look at the -I flags by using waf -v)
|
# (look at the -I flags by using waf -v)
|
||||||
|
|
|
@ -2,4 +2,5 @@ Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
.. automodule:: waflib.Build
|
.. automodule:: waflib.Build
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ ConfigSet
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. automodule:: waflib.ConfigSet
|
.. automodule:: waflib.ConfigSet
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Configure
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. automodule:: waflib.Configure
|
.. automodule:: waflib.Configure
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Context
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. automodule:: waflib.Context
|
.. automodule:: waflib.Context
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Errors
|
||||||
------
|
------
|
||||||
|
|
||||||
.. automodule:: waflib.Errors
|
.. automodule:: waflib.Errors
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Logs
|
||||||
----
|
----
|
||||||
|
|
||||||
.. automodule:: waflib.Logs
|
.. automodule:: waflib.Logs
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Node
|
||||||
----
|
----
|
||||||
|
|
||||||
.. automodule:: waflib.Node
|
.. automodule:: waflib.Node
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Options
|
||||||
-------
|
-------
|
||||||
|
|
||||||
.. automodule:: waflib.Options
|
.. automodule:: waflib.Options
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Runner
|
||||||
------
|
------
|
||||||
|
|
||||||
.. automodule:: waflib.Runner
|
.. automodule:: waflib.Runner
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Scripting
|
||||||
---------
|
---------
|
||||||
|
|
||||||
.. automodule:: waflib.Scripting
|
.. automodule:: waflib.Scripting
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Task
|
||||||
----
|
----
|
||||||
|
|
||||||
.. automodule:: waflib.Task
|
.. automodule:: waflib.Task
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ TaskGen
|
||||||
-------
|
-------
|
||||||
|
|
||||||
.. automodule:: waflib.TaskGen
|
.. automodule:: waflib.TaskGen
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,5 @@ Utils
|
||||||
-----
|
-----
|
||||||
|
|
||||||
.. automodule:: waflib.Utils
|
.. automodule:: waflib.Utils
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
@ -3,9 +3,5 @@
|
||||||
About this documentation
|
About this documentation
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
|
This is the automatically generated documentation for the Waf project.
|
||||||
document processor specifically written for the Python documentation.
|
|
||||||
|
|
||||||
.. _reStructuredText: http://docutils.sf.net/rst.html
|
|
||||||
.. _Sphinx: http://sphinx.pocoo.org/
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,14 @@ sys.path.append(os.path.abspath('.'))
|
||||||
|
|
||||||
graphviz_output_format = 'svg'
|
graphviz_output_format = 'svg'
|
||||||
|
|
||||||
|
html_theme_options = {
|
||||||
|
"body_min_width": "none",
|
||||||
|
"body_max_width": "none",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inheritance_graph_attrs = dict(rankdir="LR", size='""', fontsize=14, ratio='compress')
|
||||||
|
|
||||||
# monkey patch a few waf classes for documentation purposes!
|
# monkey patch a few waf classes for documentation purposes!
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
|
|
||||||
|
@ -170,8 +178,9 @@ Configure.ConfigurationContext.__doc__ = """
|
||||||
ctx.myhelper()
|
ctx.myhelper()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from waflib.Tools import asm
|
||||||
|
del asm.__dict__['link_task']
|
||||||
|
del asm.__dict__['stlink_task']
|
||||||
|
|
||||||
# Import all tools and build tool->feature map
|
# Import all tools and build tool->feature map
|
||||||
tool_to_features = {}
|
tool_to_features = {}
|
||||||
|
@ -207,7 +216,7 @@ for x in lst:
|
||||||
tool_to_features[x].append(feat)
|
tool_to_features[x].append(feat)
|
||||||
|
|
||||||
txt = ""
|
txt = ""
|
||||||
txt += "%s\n%s\n\n.. automodule:: waflib.Tools.%s\n\n" % (x, "="*len(x), x)
|
txt += "%s\n%s\n\n.. automodule:: waflib.Tools.%s\n :members:\n\n" % (x, "="*len(x), x)
|
||||||
if x in tool_to_features:
|
if x in tool_to_features:
|
||||||
txt += "Features defined in this module:"
|
txt += "Features defined in this module:"
|
||||||
for feat in sorted(list(set(tool_to_features[x]))):
|
for feat in sorted(list(set(tool_to_features[x]))):
|
||||||
|
@ -258,7 +267,8 @@ for z in lst:
|
||||||
for x, y in links:
|
for x, y in links:
|
||||||
ms.append('\t\t"%s" -> "%s" [arrowsize=0.5,style="setlinewidth(0.5)"];' % (x, y))
|
ms.append('\t\t"%s" -> "%s" [arrowsize=0.5,style="setlinewidth(0.5)"];' % (x, y))
|
||||||
|
|
||||||
rs = '\tdigraph feature_%s {\n\t\tsize="8.0, 12.0";\n%s\n\t}\n' % (z == '*' and 'all' or z, '\n'.join(ms))
|
#rs = '\tdigraph feature_%s {\n\t\tsize="8.0, 12.0";\n%s\n\t}\n' % (z == '*' and 'all' or z, '\n'.join(ms))
|
||||||
|
rs = '\tdigraph feature_%s {\n\t\t\n%s\n\t}\n' % (z == '*' and 'all' or z, '\n'.join(ms))
|
||||||
title = "Feature %s" % (z == '*' and '\\*' or z)
|
title = "Feature %s" % (z == '*' and '\\*' or z)
|
||||||
title += "\n" + len(title) * '='
|
title += "\n" + len(title) * '='
|
||||||
|
|
||||||
|
@ -347,7 +357,7 @@ master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Waf'
|
project = u'Waf'
|
||||||
copyright = u'2005-2018, Thomas Nagy'
|
copyright = u'2005-2023 waf.io'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
@ -495,7 +505,7 @@ latex_elements = {
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'waf.tex', u'waf Documentation',
|
('index', 'waf.tex', u'waf Documentation',
|
||||||
u'Thomas Nagy', 'manual'),
|
u'waf.io', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
@ -528,7 +538,7 @@ latex_documents = [
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'waf', u'waf Documentation',
|
('index', 'waf', u'waf Documentation',
|
||||||
[u'Thomas Nagy'], 1)
|
[u'waf.io'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
#autodoc_default_flags = ['members', 'no-undoc-members', 'show-inheritance']
|
#autodoc_default_flags = ['members', 'no-undoc-members', 'show-inheritance']
|
||||||
|
|
|
@ -24,7 +24,7 @@ In general, a project will consist of several phases:
|
||||||
Each phase is modelled in the wscript file as a python function which takes as argument an instance of :py:class:`waflib.Context.Context`.
|
Each phase is modelled in the wscript file as a python function which takes as argument an instance of :py:class:`waflib.Context.Context`.
|
||||||
Let's start with a new wscript file in the directory '/tmp/myproject'::
|
Let's start with a new wscript file in the directory '/tmp/myproject'::
|
||||||
|
|
||||||
def configure(conf):
|
def configure(cnf):
|
||||||
print("configure!")
|
print("configure!")
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
@ -62,7 +62,7 @@ by using the *${}* symbol, which reads the values from the attribute bld.env::
|
||||||
bld(rule='echo ${MESSAGE}', always=True)
|
bld(rule='echo ${MESSAGE}', always=True)
|
||||||
|
|
||||||
The bld object is an instance of :py:class:`waflib.Build.BuildContext`, its *env* attribute is an instance :py:class:`waflib.ConfigSet.ConfigSet`.
|
The bld object is an instance of :py:class:`waflib.Build.BuildContext`, its *env* attribute is an instance :py:class:`waflib.ConfigSet.ConfigSet`.
|
||||||
The values are set in this object to be shared/stored/loaded easily. Here is how to do the same thing by sharing data between the configuration and build::
|
This object is also accessible as an attribute on the `configure()` method's `cnf` parameter. Therefore, values can be shared/stored/loaded easily:
|
||||||
|
|
||||||
def configure(cnf):
|
def configure(cnf):
|
||||||
cnf.env.MESSAGE = 'Hello, world!'
|
cnf.env.MESSAGE = 'Hello, world!'
|
||||||
|
@ -111,9 +111,9 @@ Here is a script for a more complicated project::
|
||||||
The method :py:func:`waflib.Tools.c_config.check` executes a build internally to check if the library ``libm`` is present on the operating system.
|
The method :py:func:`waflib.Tools.c_config.check` executes a build internally to check if the library ``libm`` is present on the operating system.
|
||||||
It will then define variables such as:
|
It will then define variables such as:
|
||||||
|
|
||||||
* ``conf.env.LIB_M = ['m']``
|
* ``cnf.env.LIB_M = ['m']``
|
||||||
* ``conf.env.CFLAGS_M = ['-Wall']``
|
* ``cnf.env.CFLAGS_M = ['-Wall']``
|
||||||
* ``conf.env.DEFINES_M = ['var=foo']``
|
* ``cnf.env.DEFINES_M = ['var=foo']``
|
||||||
|
|
||||||
By stating ``use=['M', 'mylib']``, the program *app* is going to inherit all the *M* variables defined
|
By stating ``use=['M', 'mylib']``, the program *app* is going to inherit all the *M* variables defined
|
||||||
during the configuration. The program will also use the library *mylib* and both the build order and the dependencies
|
during the configuration. The program will also use the library *mylib* and both the build order and the dependencies
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/usr/bin/env Rscript
|
|
||||||
|
|
||||||
require(R.utils)
|
|
||||||
require(tools)
|
|
||||||
|
|
||||||
cmdArgs <- commandArgs(asValues = TRUE, excludeReserved = FALSE, excludeEnvVars = TRUE, os = "current")
|
|
||||||
|
|
||||||
if(!is.null(cmdArgs[["numTrees"]])) nTrees <- (as.integer(cmdArgs[["numTrees"]])) else nTrees <- 500
|
|
||||||
|
|
||||||
ffff <- cmdArgs[["ffff"]]
|
|
||||||
print(paste("nTrees =", nTrees, sep = " "))
|
|
||||||
|
|
||||||
Sweave(ffff)
|
|
||||||
texi2dvi("testSweave.tex", pdf = TRUE)
|
|
||||||
|
|
||||||
Stangle(ffff)
|
|
||||||
source("testSweave.R")
|
|
||||||
|
|
||||||
print(paste("Current Date/Time: ", date(), sep=""))
|
|
||||||
|
|
||||||
(sessionInfoObj <- sessionInfo())
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
\documentclass{article}
|
|
||||||
\SweaveOpts{eps=FALSE}
|
|
||||||
|
|
||||||
<<setup, echo=FALSE, results=hide>>=
|
|
||||||
options(width=80)
|
|
||||||
@
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
Estimate a random Forest model composed of
|
|
||||||
\Sexpr{format(nTrees, big.mark = ',')}
|
|
||||||
trees.
|
|
||||||
|
|
||||||
\end{document}
|
|
|
@ -1,29 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
VERSION = '1.0.0'
|
|
||||||
APPNAME = 'testR'
|
|
||||||
|
|
||||||
top = '.'
|
|
||||||
out = 'build'
|
|
||||||
|
|
||||||
def configure(ctx):
|
|
||||||
ctx.find_program('texi2dvi')
|
|
||||||
ctx.load('R')
|
|
||||||
|
|
||||||
def build(ctx):
|
|
||||||
ctx(
|
|
||||||
rule = '${R} CMD BATCH ${tsk.generator.ropts} ${tsk.generator.fopt % tsk.inputs[1].abspath()} -- ${SRC[0].abspath()} foo.log',
|
|
||||||
source = 'src/test.R src/testSweave.Rnw',
|
|
||||||
target = 'src/testSweave.pdf',
|
|
||||||
cwd = ctx.path.find_node('src').get_bld().abspath(),
|
|
||||||
install_path = '${PREFIX}/share',
|
|
||||||
shell = False,
|
|
||||||
ropts = '--no-restore --no-save --no-readline --numTrees=1000',
|
|
||||||
fopt = '--ffff=%s'
|
|
||||||
)
|
|
||||||
|
|
||||||
def dist(ctx):
|
|
||||||
ctx.algo = 'zip'
|
|
||||||
ctx.excl = ' **/waf-* **/.waf-* **/*~ **/*.orig **/*.pyc **/*.pyo **/*.bak **/.lock-w* **/*.log **/*.lot **/*.lof **/*.lst **/*.aux **/*.bbl **/*.blg **/*.out **/*.toc'
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
World.SayHello()
|
|
|
@ -1,3 +0,0 @@
|
||||||
class World:
|
|
||||||
static def SayHello():
|
|
||||||
print "hello from boo"
|
|
|
@ -1,6 +0,0 @@
|
||||||
public class World {
|
|
||||||
public static void SayHello()
|
|
||||||
{
|
|
||||||
System.Console.WriteLine("Hello from C#");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
|
|
||||||
##
|
|
||||||
# This wscript shows the power of the CLI!
|
|
||||||
# You have an hello.exe using a world.dll,
|
|
||||||
# the world.dll can be generating using
|
|
||||||
# world.cs (in C#) or world.boo.
|
|
||||||
|
|
||||||
top = '.'
|
|
||||||
out = 'build'
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
opt.load('cs')
|
|
||||||
opt.add_option("--use-cs", dest="use_cs", action="store_true",
|
|
||||||
help="use world.cs to generate world.dll")
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.env.USE_CS = conf.options.use_cs
|
|
||||||
if conf.env.USE_CS:
|
|
||||||
conf.load('cs')
|
|
||||||
conf.load('boo')
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
if bld.env.USE_CS:
|
|
||||||
# C# world library
|
|
||||||
bld(features = "cs",
|
|
||||||
source = "world.cs",
|
|
||||||
type = "library",
|
|
||||||
gen = "world.dll",
|
|
||||||
name = "world"
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
|
||||||
# boo world library
|
|
||||||
bld(features = "boo",
|
|
||||||
source = "world.boo",
|
|
||||||
type = "library",
|
|
||||||
gen = "world.dll",
|
|
||||||
name = "world"
|
|
||||||
)
|
|
||||||
|
|
||||||
# executable that uses the world library
|
|
||||||
bld(features = "boo",
|
|
||||||
source = "hello.boo",
|
|
||||||
type = "exe",
|
|
||||||
gen = "hello.exe",
|
|
||||||
use = "world"
|
|
||||||
)
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Clang-CL
|
||||||
|
|
||||||
|
Clang-CL is a drop-in MSVC compatible driver replacing CL.exe
|
||||||
|
The clang compiler offers high compatibility with MSVC, but also offers more up to date C++ support.
|
||||||
|
It features better code generation, but still adheres to the MSVC ABI, letting you link with link.exe, offering you superior performance but also PDB debug info.
|
||||||
|
|
||||||
|
On Windows this waf module should just work, on Linux it tries to find the LLVM replacements and requires an environment containing the paths defined by the vsvars batch files (Visual Studio C++ Developer command prompt).
|
||||||
|
|
||||||
|
# Cross compilation
|
||||||
|
|
||||||
|
To cross compile for Windows from Linux, you will require the following:
|
||||||
|
|
||||||
|
* A partition with Windows installed (NTFS).
|
||||||
|
* Visual Studio (Tested with 2017).
|
||||||
|
* The Windows SDK.
|
||||||
|
* lowntfs-3g file system driver.
|
||||||
|
|
||||||
|
Make sure the Windows partition is mounted with `-t lowntfs-3g -o defaults,ignore_case,windows_names`.
|
||||||
|
This will allow Clang to find all headers and libraries referenced by scripts and headers, otherwise you will run into case sensitivity errors.
|
||||||
|
You can run a script to make all filenames lowercase, but that edits your Visual Studio installation, and I don't know if that has an effect on upgradability.
|
||||||
|
|
||||||
|
Clang uses the following environment variables to detect the Visual Studio install: `VCINSTALLDIR`, `VCToolsInstallDir`, `INCLUDE`, `LIB`, `LIBPATH`
|
||||||
|
I just copied these from the output of the `set` command in an MSVC command prompt on Windows and translated the paths to Linux paths.
|
||||||
|
Notice how the semicolon is still used as a path separator.
|
||||||
|
See `example_environment_linux.sh` for how my setup looks like. It expects the Windows partition to be mounted on `/mnt/windows`, with VS2017 installed and Windows 10 SDK 10.0.17763.0.
|
||||||
|
|
||||||
|
To specify a custom LLVM installation, you can put the path in the `LLVM_PATH` environment variable, or put the path in `cfg.env.LLVM_PATH` in your wscript.
|
|
@ -0,0 +1,5 @@
|
||||||
|
export VCINSTALLDIR="/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/"
|
||||||
|
export VCToolsInstallDir="/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/"
|
||||||
|
export INCLUDE="/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/atlmfc/include;/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/include;/mnt/windows/program files (x86)/windows kits/10/include/10.0.17763.0/ucrt;/mnt/windows/program files (x86)/windows kits/10/include/10.0.17763.0/shared;/mnt/windows/program files (x86)/windows kits/10/include/10.0.17763.0/um;/mnt/windows/program files (x86)/windows kits/10/include/10.0.17763.0/winrt;/mnt/windows/program files (x86)/windows kits/10/include/10.0.17763.0/cppwinrt"
|
||||||
|
export LIB="/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/atlmfc/lib/x64;/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/lib/x64;/mnt/windows/program files (x86)/windows kits/10/lib/10.0.17763.0/ucrt/x64;/mnt/windows/program files (x86)/windows kits/10/lib/10.0.17763.0/um/x64"
|
||||||
|
export LIBPATH="/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/atlmfc/lib/x64;/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/lib/x64;/mnt/windows/program files (x86)/microsoft visual studio/2017/community/vc/tools/msvc/14.16.27023/lib/x86/store/references;/mnt/windows/program files (x86)/windows kits/10/unionmetadata/10.0.17763.0;/mnt/windows/program files (x86)/windows kits/10/references/10.0.17763.0"
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
|
puts("This is a simple test program.\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
# vim: ts=4 sw=4 noexpandtab
|
||||||
|
|
||||||
|
top = '.'
|
||||||
|
out = 'build'
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
opt.load('clang_cl')
|
||||||
|
|
||||||
|
def configure(cfg):
|
||||||
|
cfg.load('clang_cl')
|
||||||
|
cfg.env.append_value('CFLAGS','/Zi')
|
||||||
|
cfg.env.append_value('LDFLAGS','/DEBUG')
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
bld.program(
|
||||||
|
name='test',
|
||||||
|
source=['test.c'],
|
||||||
|
target='test',
|
||||||
|
use='CRT_MULTITHREADED_DLL')
|
|
@ -25,7 +25,7 @@ import random, bz2, os, threading
|
||||||
lock = threading.Lock()
|
lock = threading.Lock()
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
opt.add_option('--num', action='store', type='int', default=200, help='amount of compressed files to create')
|
opt.add_option('--num', action='store', type=int, default=200, help='amount of compressed files to create')
|
||||||
|
|
||||||
# values for storing the min and max
|
# values for storing the min and max
|
||||||
gzip = [10000000, 0]
|
gzip = [10000000, 0]
|
||||||
|
|
|
@ -10,7 +10,7 @@ from waflib.Tools import ccroot, c_preproc
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
|
||||||
class cuda(Task.Task):
|
class cuda(Task.Task):
|
||||||
run_str = '${NVCC} ${CUDAFLAGS} ${CXXFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F} ${TGT}'
|
run_str = '${NVCC} ${CUDAFLAGS} ${NVCCFLAGS_ST:CXXFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F} ${TGT}'
|
||||||
color = 'GREEN'
|
color = 'GREEN'
|
||||||
ext_in = ['.h']
|
ext_in = ['.h']
|
||||||
vars = ['CCDEPS']
|
vars = ['CCDEPS']
|
||||||
|
@ -32,6 +32,7 @@ def cxx_hook(self, node):
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
conf.find_program('nvcc', var='NVCC')
|
conf.find_program('nvcc', var='NVCC')
|
||||||
conf.find_cuda_libs()
|
conf.find_cuda_libs()
|
||||||
|
conf.env.NVCCFLAGS_ST = "--compiler-options=%s"
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def find_cuda_libs(self):
|
def find_cuda_libs(self):
|
||||||
|
|
|
@ -18,6 +18,9 @@ def configure(conf):
|
||||||
|
|
||||||
conf.load('cuda', tooldir='.')
|
conf.load('cuda', tooldir='.')
|
||||||
|
|
||||||
|
# Add a few flags to test proper passing to nvcc
|
||||||
|
conf.env.CXXFLAGS=['-fPIC', '--std=c++11']
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
# cuda application
|
# cuda application
|
||||||
|
@ -35,7 +38,7 @@ def build(bld):
|
||||||
# native application
|
# native application
|
||||||
bld.program(
|
bld.program(
|
||||||
source = 'test.cpp',
|
source = 'test.cpp',
|
||||||
target = 'testapp')
|
target = 'testapp-native')
|
||||||
|
|
||||||
# cuda application
|
# cuda application
|
||||||
bld.program(
|
bld.program(
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2016 (ita)
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
opt.load('compiler_c')
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.load('compiler_c')
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
bld.load('print_commands')
|
|
||||||
bld.program(source='main.c', target='app')
|
|
||||||
|
|
|
@ -40,7 +40,10 @@ else:
|
||||||
with open(tf, 'wb') as f:
|
with open(tf, 'wb') as f:
|
||||||
f.write(pkgdata)
|
f.write(pkgdata)
|
||||||
with tarfile.open(tf) as f:
|
with tarfile.open(tf) as f:
|
||||||
f.extractall(tmp)
|
if hasattr(tarfile, 'data_filter'):
|
||||||
|
f.extractall(tmp, filter='data')
|
||||||
|
else:
|
||||||
|
f.extractall(tmp)
|
||||||
os.remove(tf)
|
os.remove(tf)
|
||||||
os.rename(tmp, dest)
|
os.rename(tmp, dest)
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include <pkg1/exLibC/exLibC.hpp>
|
#include <pkg1/exLibC/exLibC.hpp>
|
||||||
|
|
||||||
int check_smaller(int value) {
|
int check_smaller(int value) {
|
||||||
|
const char* foo = u8"bar"; // u8 is C++17 only
|
||||||
|
std::cout << __cplusplus << std::endl; // Check version of C++ standard
|
||||||
|
|
||||||
if (value < HELLO_LIMIT) {
|
if (value < HELLO_LIMIT) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,12 +2,15 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
# We are using C++
|
# We are using C and C++
|
||||||
opt.load('compiler_cxx')
|
opt.load('compiler_c compiler_cxx')
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
# We are using C++
|
# We are using C and C++
|
||||||
conf.load('compiler_cxx')
|
conf.load('compiler_c compiler_cxx')
|
||||||
|
# Force some standards to see that IDE will follow them
|
||||||
|
conf.env.CXXFLAGS=['-std=c++17']
|
||||||
|
conf.env.CFLAGS=['-std=c17']
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
bld.shlib(source='exLibC/src/exLibC.cpp', includes='exLibC/src/include', target='exampleLibC', export_includes='exLibC/src/include/')
|
bld.shlib(source='exLibC/src/exLibC.cpp', includes='exLibC/src/include', target='exampleLibC', export_includes='exLibC/src/include/')
|
||||||
|
|
|
@ -54,6 +54,7 @@ def options(opt):
|
||||||
|
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
|
conf.env.ECLIPSE_EXTRA_TARGETS = ['test', 'lint', 'foo --bar']
|
||||||
conf.load('eclipse')
|
conf.load('eclipse')
|
||||||
# We recurse configurations in our submodules
|
# We recurse configurations in our submodules
|
||||||
conf.recurse(module_list)
|
conf.recurse(module_list)
|
||||||
|
|
|
@ -24,6 +24,7 @@ def build(bld):
|
||||||
name='example',
|
name='example',
|
||||||
source='main.c',
|
source='main.c',
|
||||||
features='file_to_object',
|
features='file_to_object',
|
||||||
|
includes_nodes=[],
|
||||||
)
|
)
|
||||||
bld(
|
bld(
|
||||||
target = 'app',
|
target = 'app',
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2010 (ita)
|
|
||||||
|
|
||||||
top = '.'
|
|
||||||
out = 'build'
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
opt.load('compiler_c')
|
|
||||||
opt.load('errcheck')
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.load('compiler_c')
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
bld(feature='c cprogram', source='main.c', target='app1')
|
|
||||||
bld.program(sources='main.c', target='app2')
|
|
||||||
bld.program(source='main.c', targets='app3')
|
|
||||||
bld.program(source='main.c', target='app4', include='.')
|
|
||||||
bld.program(source='main.c', target='app5', define='x=1')
|
|
|
@ -1,3 +0,0 @@
|
||||||
"""
|
|
||||||
nothing to see here
|
|
||||||
"""
|
|
|
@ -1,15 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2010 (ita)
|
|
||||||
|
|
||||||
"""
|
|
||||||
Setting the source directory below the current folder is a
|
|
||||||
bad idea in general
|
|
||||||
"""
|
|
||||||
|
|
||||||
top = 'src'
|
|
||||||
out = 'build'
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
pass
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ def h_file(filename):
|
||||||
"""now folders can have a signature too"""
|
"""now folders can have a signature too"""
|
||||||
st = os.stat(filename)
|
st = os.stat(filename)
|
||||||
if stat.S_ISDIR(st[stat.ST_MODE]):
|
if stat.S_ISDIR(st[stat.ST_MODE]):
|
||||||
return Utils.md5(filename).digest()
|
return Utils.md5(filename.encode('latin-1')).digest()
|
||||||
m = Utils.md5()
|
m = Utils.md5()
|
||||||
m.update(str(st.st_mtime))
|
m.update(str(st.st_mtime))
|
||||||
m.update(str(st.st_size))
|
m.update(str(st.st_size))
|
||||||
m.update(filename)
|
m.update(filename.encode('latin-1'))
|
||||||
return m.digest()
|
return m.digest()
|
||||||
Utils.h_file = h_file
|
Utils.h_file = h_file
|
||||||
|
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2006-2008 (ita)
|
|
||||||
|
|
||||||
"""
|
|
||||||
Native compilation using gcj
|
|
||||||
|
|
||||||
highly experimental, and gcj sucks anyway
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os, re
|
|
||||||
from waflib.Configure import conf
|
|
||||||
from waflib import TaskGen, Task, Utils, Node
|
|
||||||
from waflib.TaskGen import feature, before, after
|
|
||||||
from waflib.Tools import ccroot
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.find_program('gcj', var='GCJ')
|
|
||||||
conf.env.GCJLINK = conf.env.GCJ
|
|
||||||
conf.env.GCJLINKFLAGS_gcj_shlib = ['-shared']
|
|
||||||
conf.env.GCJFLAGS_gcj_shlib = ['-fPIC']
|
|
||||||
|
|
||||||
class gcj(Task.Task):
|
|
||||||
run_str = '${GCJ} ${GCJFLAGS} -classpath ${CLASSPATH} -c -o ${TGT} ${SRC}'
|
|
||||||
|
|
||||||
class gcj_program(ccroot.link_task):
|
|
||||||
run_str = '${GCJLINK} ${GCJLINKFLAGS} ${SRC} -o ${TGT}'
|
|
||||||
color = 'YELLOW'
|
|
||||||
|
|
||||||
class gcj_shlib(gcj_program):
|
|
||||||
pass
|
|
||||||
|
|
||||||
ccroot.USELIB_VARS['gcj'] = set(['CLASSPATH', 'JAVACFLAGS', 'GCJFLAGS'])
|
|
||||||
ccroot.USELIB_VARS['gcj_program'] = set(['CLASSPATH', 'JAVACFLAGS', 'GCJLINKFLAGS'])
|
|
||||||
ccroot.USELIB_VARS['gcj_shlib'] = set(['CLASSPATH', 'JAVACFLAGS', 'GCJLINKFLAGS'])
|
|
||||||
feature('gcj_program', 'gcj_shlib')(ccroot.apply_link)
|
|
||||||
feature('gcj_program', 'gcj_shlib')(ccroot.propagate_uselib_vars)
|
|
||||||
|
|
||||||
@feature('gcj')
|
|
||||||
@after('propagate_uselib_vars', 'apply_gcj')
|
|
||||||
def set_gcj_classpath(self):
|
|
||||||
lst = [isinstance(x, str) and x or x.abspath() for x in self.env.CLASSPATH]
|
|
||||||
self.env.CLASSPATH = os.pathsep.join(lst) + os.pathsep
|
|
||||||
|
|
||||||
@feature('gcj')
|
|
||||||
@before('apply_java')
|
|
||||||
def apply_gcj(self):
|
|
||||||
if 'javac' in self.features:
|
|
||||||
self.bld.fatal('feature gcj_native is not compatible with javac %r' % self)
|
|
||||||
|
|
||||||
srcdir = getattr(self, 'srcdir', '')
|
|
||||||
if isinstance(srcdir, Node.Node):
|
|
||||||
srcdir = [srcdir]
|
|
||||||
|
|
||||||
tmp = []
|
|
||||||
for x in Utils.to_list(srcdir):
|
|
||||||
if isinstance(x, Node.Node):
|
|
||||||
y = x
|
|
||||||
else:
|
|
||||||
y = self.path.find_dir(x)
|
|
||||||
if not y:
|
|
||||||
self.bld.fatal('Could not find the folder %s from %s' % (x, self.path))
|
|
||||||
tmp.append(y)
|
|
||||||
|
|
||||||
nodes = []
|
|
||||||
for x in tmp:
|
|
||||||
nodes.extend(x.ant_glob('**/*.java'))
|
|
||||||
|
|
||||||
if not getattr(self, 'gcjonce', None):
|
|
||||||
for x in nodes:
|
|
||||||
self.create_compiled_task('gcj', x)
|
|
||||||
|
|
||||||
#############################################################
|
|
||||||
# gcj is still beta software
|
|
||||||
# and this workaround cannot work for shared object (-fPIC)
|
|
||||||
|
|
||||||
class fix_dummy(Task.Task):
|
|
||||||
run_str = 'objcopy -L _ZGr8_$$_dummy ${SRC}'
|
|
||||||
before = ['gcj_program', 'gcj_shlib']
|
|
||||||
|
|
||||||
@feature('gcj')
|
|
||||||
@after('apply_gcj')
|
|
||||||
def gcj_developers_like_duplicate_dummy_symbols(self):
|
|
||||||
if self.env.FIX_DUMMY:
|
|
||||||
for tsk in self.compiled_tasks:
|
|
||||||
if isinstance(tsk, gcj):
|
|
||||||
self.create_task('fix_dummy', tsk.outputs[0])
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
public class Hi {
|
|
||||||
public Hi() {
|
|
||||||
System.out.println("hi");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
package es;
|
|
||||||
|
|
||||||
public class Comp {
|
|
||||||
public static final String WAF = "-.-.-.-.-";
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package es; // obligatory
|
|
||||||
|
|
||||||
import es.Comp;
|
|
||||||
|
|
||||||
public class Hello
|
|
||||||
{
|
|
||||||
int m_var = 0;
|
|
||||||
public Hello()
|
|
||||||
{
|
|
||||||
this.m_var = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyHelperClass
|
|
||||||
{
|
|
||||||
MyHelperClass() { }
|
|
||||||
int someHelperMethod(int z, int q) { return 2; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object makeObj(String name)
|
|
||||||
{
|
|
||||||
final String objName = "My name is " + name;
|
|
||||||
|
|
||||||
return new Object() {
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return objName;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String args[])
|
|
||||||
{
|
|
||||||
System.out.println("Hello, world" + Comp.WAF);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#! /usr/bin/env python
|
|
||||||
# encoding: utf-8
|
|
||||||
# Thomas Nagy, 2008 (ita)
|
|
||||||
|
|
||||||
VERSION='0.0.2'
|
|
||||||
APPNAME='gcj_test'
|
|
||||||
|
|
||||||
top = '.'
|
|
||||||
out = 'out'
|
|
||||||
|
|
||||||
def configure(conf):
|
|
||||||
conf.load('gcj', tooldir='.')
|
|
||||||
conf.env.FIX_DUMMY = True
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
bld(
|
|
||||||
features = 'gcj gcj_program',
|
|
||||||
srcdir = 'src more',
|
|
||||||
target = 'test',
|
|
||||||
gcjlinkflags = '--main=es.Hello',
|
|
||||||
classpath = [bld.path.find_dir(x) for x in ('src', 'more')],
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#include "example.h"
|
|
||||||
|
|
||||||
constexpr int Example::not_exposed;
|
|
||||||
|
|
||||||
int Example::calculate(int some_argument) const { return _value + some_argument; }
|
|
||||||
|
|
||||||
int Example::getSomething() const { return _value; }
|
|
||||||
|
|
||||||
void Example::setSomething(int value) { _value = value; }
|
|
|
@ -1,20 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "genpybind.h"
|
|
||||||
|
|
||||||
class GENPYBIND(visible) Example {
|
|
||||||
public:
|
|
||||||
static constexpr int GENPYBIND(hidden) not_exposed = 10;
|
|
||||||
|
|
||||||
/// \brief Do a complicated calculation.
|
|
||||||
int calculate(int some_argument = 5) const;
|
|
||||||
|
|
||||||
GENPYBIND(getter_for(something))
|
|
||||||
int getSomething() const;
|
|
||||||
|
|
||||||
GENPYBIND(setter_for(something))
|
|
||||||
void setSomething(int value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
int _value = 0;
|
|
||||||
};
|
|
|
@ -1,9 +0,0 @@
|
||||||
import pyexample as m
|
|
||||||
|
|
||||||
|
|
||||||
def test_example():
|
|
||||||
obj = m.Example()
|
|
||||||
obj.something = 42
|
|
||||||
assert obj.something == 42
|
|
||||||
assert obj.calculate() == 47 # with default argument
|
|
||||||
assert obj.calculate(2) == 44
|
|
|
@ -1,37 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
|
|
||||||
def options(opt):
|
|
||||||
opt.load('python')
|
|
||||||
opt.load('compiler_cxx')
|
|
||||||
opt.load('genpybind')
|
|
||||||
|
|
||||||
|
|
||||||
def configure(cfg):
|
|
||||||
cfg.load('python')
|
|
||||||
cfg.load('compiler_cxx')
|
|
||||||
cfg.check_python_version((2, 7))
|
|
||||||
cfg.check_python_headers()
|
|
||||||
cfg.load('genpybind')
|
|
||||||
|
|
||||||
cfg.check(compiler='cxx',
|
|
||||||
features='cxx pyext',
|
|
||||||
uselib_store='PYBIND11GENPYBIND_EXAMPLE',
|
|
||||||
mandatory=True,
|
|
||||||
header_name='pybind11/pybind11.h')
|
|
||||||
|
|
||||||
|
|
||||||
def build(bld):
|
|
||||||
bld(target='example_inc',
|
|
||||||
export_includes='.')
|
|
||||||
|
|
||||||
bld.shlib(target='example',
|
|
||||||
source='example.cpp',
|
|
||||||
features='use',
|
|
||||||
use='example_inc')
|
|
||||||
|
|
||||||
bld(target='pyexample',
|
|
||||||
source='example.h',
|
|
||||||
genpybind_tags='genpybind_example',
|
|
||||||
features='use genpybind cxx cxxshlib pyext',
|
|
||||||
use=['PYBIND11GENPYBIND_EXAMPLE', 'example'])
|
|
|
@ -29,22 +29,22 @@ def gtest_results(bld):
|
||||||
lst = getattr(bld, 'utest_results', [])
|
lst = getattr(bld, 'utest_results', [])
|
||||||
if not lst:
|
if not lst:
|
||||||
return
|
return
|
||||||
for (f, code, out, err) in lst:
|
for result in lst:
|
||||||
# if not code:
|
# if not result.exit_code:
|
||||||
# continue
|
# continue
|
||||||
|
|
||||||
# uncomment if you want to see what's happening
|
# uncomment if you want to see what's happening
|
||||||
# print(str(out, 'utf-8'))
|
# print(str(out, 'utf-8'))
|
||||||
output = str(out, 'utf-8').splitlines()
|
output = str(result.out, 'utf-8').splitlines()
|
||||||
for i, line in enumerate(output):
|
for i, line in enumerate(output):
|
||||||
if '[ RUN ]' in line and code:
|
if '[ RUN ]' in line and result.exit_code:
|
||||||
i += 1
|
i += 1
|
||||||
if ' OK ]' in output[i]:
|
if ' OK ]' in output[i]:
|
||||||
continue
|
continue
|
||||||
while not '[ ' in output[i]:
|
while not '[ ' in output[i]:
|
||||||
Logs.warn(output[i])
|
Logs.warn(output[i])
|
||||||
i += 1
|
i += 1
|
||||||
elif ' FAILED ]' in line and code:
|
elif ' FAILED ]' in line and result.exit_code:
|
||||||
Logs.error(line)
|
Logs.error(line)
|
||||||
elif ' PASSED ]' in line:
|
elif ' PASSED ]' in line:
|
||||||
Logs.info(line)
|
Logs.info(line)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class Main {
|
||||||
|
static function main() {
|
||||||
|
trace('hello');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.load('haxe')
|
||||||
|
ctx.check_haxe(mini='4.0.0', maxi='4.7.5')
|
||||||
|
ctx.check_haxe_pkg(
|
||||||
|
libs=['hashlink'],
|
||||||
|
uselib_store='HLR',
|
||||||
|
fetch=False)
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.env.HAXE_FLAGS = ['-dce', 'full', '-main', 'Main']
|
||||||
|
ctx(
|
||||||
|
compiler = 'HL',
|
||||||
|
source = 'Main.hx',
|
||||||
|
target = 'out.hl',
|
||||||
|
use = ['HLR'])
|
|
@ -0,0 +1,8 @@
|
||||||
|
top = '.'
|
||||||
|
out = 'build'
|
||||||
|
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.recurse('src')
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.recurse('src')
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Using `HLC` source generation with `clang`
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
In this particular case, you need to have a distribution of `hashlink` in your system. After installing, you need to perform additional steps to pass required files for binary generation (in this case - to `clang`):
|
||||||
|
|
||||||
|
- either add hashlink's `lib` folder to `ctx.env.LIBPATH_HL`
|
||||||
|
- or replace `lib` folder with a symlink to hashlink's `lib` folder
|
||||||
|
- either add hashlink's `include` folder to `ctx.env.INCLUDES_HL`
|
||||||
|
- or replace `include` folder with a symlink to hashlink's `include` folder
|
||||||
|
|
||||||
|
## Targets
|
||||||
|
In this particular case, generated `.c` files are placed in separate `bin` subdirectory. This enhances your build transparency and allows you to add desired checks or perform additional operations with generated `.c` sources if needed, while keeping things in parallel. Keep this in mind if you're planning to extend your build layout with additional Haxe targets
|
||||||
|
|
||||||
|
## Running assembled binaries
|
||||||
|
Assuming that you have a `hashlink` distribution and all relevant system paths are adjusted, you could easily run your binary and see resulting output of `Main.hx:3: hello`. Keep in mind that if you're using an official `hashlink` distribution, it doesn't come with static libs for linking - this means that your produced binary requires paths to `libhl.dll` (or `.so`/`.dylib` - depends on your system). Of course, there may be a use case when you're building `hashlink` from sources or using it as a portable distribution - in these cases, you could run your binary while pointing paths to your dynamic libraries with adding correct paths (`$PWD/lib/` for example) to:
|
||||||
|
|
||||||
|
- `PATH` on windows
|
||||||
|
- `LD_LIBRARY_PATH` on linux
|
||||||
|
- `DYLD_LIBRARY_PATH` on macOS
|
|
@ -0,0 +1,14 @@
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.load('clang')
|
||||||
|
ctx.check(
|
||||||
|
compiler='c',
|
||||||
|
lib='hl',
|
||||||
|
use='HL',
|
||||||
|
uselib_store='HL')
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.program(
|
||||||
|
source = [ctx.bldnode.make_node('src/main/main.c')],
|
||||||
|
includes = [ctx.env.ROOT_INCLUDE_DIR],
|
||||||
|
target = 'app',
|
||||||
|
use = ['HL'])
|
|
@ -0,0 +1 @@
|
||||||
|
place hashlink includes here (e.g. hlc.h) or replace this directory with symlink if using package manager - dedicated directory is used when native hashlink includes are used
|
|
@ -0,0 +1 @@
|
||||||
|
place hashlink libraries here (e.g. libhl.so) or replace this directory with symlink if using package manager - dedicated directory is used when native hashlink libs are linked
|
|
@ -0,0 +1,5 @@
|
||||||
|
class Main {
|
||||||
|
static function main() {
|
||||||
|
trace('hello');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.load('haxe')
|
||||||
|
ctx.check_haxe(mini='4.0.0', maxi='4.2.5')
|
||||||
|
ctx.check_haxe_pkg(
|
||||||
|
libs=['hashlink'],
|
||||||
|
uselib_store='HLR')
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.env.HAXE_FLAGS = ['-dce', 'full', '-main', 'Main']
|
||||||
|
ctx(
|
||||||
|
compiler = 'HLC',
|
||||||
|
source = 'Main.hx',
|
||||||
|
res = ctx.env.ROOT_RES_DIR,
|
||||||
|
target = 'main',
|
||||||
|
use = ['HLR'])
|
|
@ -0,0 +1,15 @@
|
||||||
|
top = '.'
|
||||||
|
out = 'bin/waf'
|
||||||
|
|
||||||
|
def configure(ctx):
|
||||||
|
ctx.env.ROOT_INCLUDE_DIR = ctx.path.get_bld().make_node('src').make_node('main').abspath()
|
||||||
|
ctx.env.ROOT_RES_DIR = ctx.path.make_node('res').abspath()
|
||||||
|
ctx.env.LIBPATH_HAXE = ctx.path.make_node('haxe_libraries').abspath()
|
||||||
|
ctx.env.LIBPATH_HL = ctx.path.make_node('lib').abspath()
|
||||||
|
ctx.env.INCLUDES_HL = ctx.path.make_node('include').abspath()
|
||||||
|
ctx.recurse('src')
|
||||||
|
ctx.recurse('bin')
|
||||||
|
|
||||||
|
def build(ctx):
|
||||||
|
ctx.recurse('src')
|
||||||
|
ctx.recurse('bin')
|
|
@ -14,9 +14,9 @@ def build(bld):
|
||||||
|
|
||||||
|
|
||||||
from waflib import Utils
|
from waflib import Utils
|
||||||
from waflib.TaskGen import feature, after
|
from waflib.TaskGen import feature, after_method
|
||||||
@feature('hidden')
|
@feature('hidden')
|
||||||
@after('apply_rule')
|
@after_method('process_rule')
|
||||||
def hide_it(self):
|
def hide_it(self):
|
||||||
self.tasks[0].__class__.log_display = Utils.nada
|
self.tasks[0].__class__.log_display = Utils.nada
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ def configure(conf):
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
bld(rule='echo "int ko = $$RANDOM;" > ${TGT}', target='faa.h', always=True, shell=True, name='z2')
|
bld(rule='echo "int ko = $$$$ ;" > ${TGT}', target='faa.h', always=True, shell=True, name='z2')
|
||||||
bld.program(source='a.c main.c', target='foo', includes='.')
|
bld.program(source='a.c main.c', target='foo', includes='.')
|
||||||
|
|
||||||
# sort the tasks in reverse order to force the 'faa.h' creation in last position
|
# sort the tasks in reverse order to force the 'faa.h' creation in last position
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
# Simple script to demonstrate integration of Java Unit testing inside
|
# Simple script to demonstrate integration of Java Unit testing inside
|
||||||
# standard waf_unit_test using either TestNG or JUnit
|
# standard waf_unit_test using either TestNG or JUnit
|
||||||
#
|
#
|
||||||
|
# try:
|
||||||
|
# waf configure --jtpath=/usr/share/java/testng.jar:/usr/share/java/jcommander.jar clean build
|
||||||
|
|
||||||
def test_results(bld):
|
def test_results(bld):
|
||||||
"""
|
"""
|
||||||
|
@ -14,9 +16,9 @@ def test_results(bld):
|
||||||
lst = getattr(bld, 'utest_results', [])
|
lst = getattr(bld, 'utest_results', [])
|
||||||
if not lst:
|
if not lst:
|
||||||
return
|
return
|
||||||
for (f, code, out, err) in lst:
|
for result in lst:
|
||||||
print(out.decode('utf-8'))
|
print(result.out.decode('utf-8'))
|
||||||
print(err.decode('utf-8'))
|
print(result.err.decode('utf-8'))
|
||||||
|
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
|
|
|
@ -1,2 +1,8 @@
|
||||||
ENTRY(init)
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x20000;
|
||||||
|
.text : { *(.text) }
|
||||||
|
. = 0x986754;
|
||||||
|
.data : { *(.data) }
|
||||||
|
.bss : { *(.bss) }
|
||||||
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ def build(bld):
|
||||||
linkflags = ['-nostdlib'],
|
linkflags = ['-nostdlib'],
|
||||||
)
|
)
|
||||||
|
|
||||||
from waflib import Utils
|
from waflib import Errors
|
||||||
from waflib.TaskGen import after, feature
|
from waflib.TaskGen import after_method, feature
|
||||||
|
|
||||||
@after('apply_link')
|
@after_method('propagate_uselib_vars')
|
||||||
@feature('cprogram', 'cshlib')
|
@feature('cprogram', 'cshlib')
|
||||||
def process_ldscript(self):
|
def process_ldscript(self):
|
||||||
if not getattr(self, 'ldscript', None) or self.env.CC_NAME != 'gcc':
|
if not getattr(self, 'ldscript', None) or self.env.CC_NAME != 'gcc':
|
||||||
|
@ -31,7 +31,7 @@ def process_ldscript(self):
|
||||||
|
|
||||||
node = self.path.find_resource(self.ldscript)
|
node = self.path.find_resource(self.ldscript)
|
||||||
if not node:
|
if not node:
|
||||||
raise Utils.WafError('could not find %r' % self.ldscript)
|
raise Errors.WafError('could not find %r' % self.ldscript)
|
||||||
self.link_task.env.append_value('LINKFLAGS', '-Wl,-T,%s' % node.abspath())
|
self.link_task.env.append_value('LINKFLAGS', '-Wl,-T,%s' % node.abspath())
|
||||||
self.link_task.dep_nodes.append(node)
|
self.link_task.dep_nodes.append(node)
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
#
|
||||||
# The following example shows how several build processes can collaborate
|
# several processes can wait on a resource limit
|
||||||
# to stop spawning new processes when a special task of type K is executed
|
# in this case the maximum amount of "very busy" tasks is one across several processes
|
||||||
# this may be useful for link tasks for example
|
# also:
|
||||||
|
# - this example is posix-only (fcntl)
|
||||||
|
# - it assumes that the lock file "busy_lock.txt" is already created by another process
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
opt.add_option('--loops', action='store', type='int', default=5, help='amount of cpu-intensive loops to perform')
|
opt.add_option('--loops', action='store', type=int, default=5, help='amount of cpu-intensive loops to perform')
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
busy = conf.path.find_node('look_busy.py').abspath()
|
busy = conf.path.find_node('look_busy.py').abspath()
|
||||||
|
@ -33,71 +35,56 @@ def lock_maxjob(self):
|
||||||
# lock the file, telling other build processes to avoid spawining tasks during that time
|
# lock the file, telling other build processes to avoid spawining tasks during that time
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.lockfd = os.open(self.generator.bld.lockfile, os.O_TRUNC | os.O_CREAT | os.O_RDWR)
|
# each task/thread will have its own "lockfd"
|
||||||
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
# it is important to not create too many of them
|
||||||
|
if not getattr(self, 'lockfd', None):
|
||||||
|
with lock:
|
||||||
|
self.lockfd = os.open(self.generator.bld.lockfile, os.O_TRUNC | os.O_CREAT | os.O_RDWR)
|
||||||
|
with lock:
|
||||||
|
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
except EnvironmentError as e:
|
except EnvironmentError as e:
|
||||||
if e.errno in (errno.EACCES, errno.EAGAIN):
|
if e.errno in (errno.EACCES, errno.EAGAIN):
|
||||||
time.sleep(0.3)
|
time.sleep(0.3)
|
||||||
continue
|
continue
|
||||||
raise
|
raise
|
||||||
os.write(self.lockfd, "%d" % os.getpid())
|
|
||||||
|
os.write(self.lockfd, b"%d %s\n" % (os.getpid(), repr(threading.current_thread()).encode()))
|
||||||
self.start_time = time.time()
|
self.start_time = time.time()
|
||||||
break
|
break
|
||||||
|
|
||||||
def release_maxjob(self):
|
def release_maxjob(self):
|
||||||
# release the lock file
|
# release the lock file
|
||||||
print("> long task %d" % (time.time() - self.start_time))
|
with lock:
|
||||||
try:
|
|
||||||
os.remove(self.generator.bld.lockfile)
|
|
||||||
os.close(self.lockfd)
|
|
||||||
except OSError, e:
|
|
||||||
# of someone else has removed the lock... bad luck! but do not fail here
|
|
||||||
print "unexpected failure", e
|
|
||||||
pass
|
|
||||||
|
|
||||||
def wait_maxjob(self):
|
|
||||||
# wait on the lock file.. up to a certain limit
|
|
||||||
while True:
|
|
||||||
try:
|
try:
|
||||||
ini = os.stat(self.generator.bld.lockfile).st_mtime
|
fcntl.flock(self.lockfd, fcntl.LOCK_UN)
|
||||||
except OSError, e:
|
os.close(self.lockfd)
|
||||||
return
|
except OSError as e:
|
||||||
diff = time.time() - ini
|
# of someone else has removed the lock... bad luck! but do not fail here
|
||||||
if diff > 300: # stale lock file? wait 5 minutes
|
pass
|
||||||
return
|
except Exception as e:
|
||||||
time.sleep(0.5)
|
print(e)
|
||||||
|
#print("lock released!", threading.current_thread())
|
||||||
|
|
||||||
# the method process is called by threads...
|
# the method process is called by threads...
|
||||||
def process2(self):
|
def process2(self):
|
||||||
|
|
||||||
if getattr(self.generator, 'exclusive', False):
|
if getattr(self.generator, 'exclusive', False):
|
||||||
lock.acquire()
|
self.lock_maxjob()
|
||||||
try:
|
|
||||||
self.lock_maxjob()
|
|
||||||
finally:
|
|
||||||
lock.release()
|
|
||||||
else:
|
|
||||||
self.wait_maxjob()
|
|
||||||
|
|
||||||
|
# regular work
|
||||||
ret = self.process_bound_maxjobs()
|
ret = self.process_bound_maxjobs()
|
||||||
|
|
||||||
if getattr(self.generator, 'exclusive', False):
|
if getattr(self.generator, 'exclusive', False):
|
||||||
lock.acquire()
|
self.release_maxjob()
|
||||||
try:
|
|
||||||
self.release_maxjob()
|
|
||||||
finally:
|
|
||||||
lock.release()
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
try:
|
try:
|
||||||
process2(self)
|
process2(self)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print type(e), e
|
print(type(e), e)
|
||||||
|
|
||||||
Task.Task.process_bound_maxjobs = Task.Task.process
|
Task.Task.process_bound_maxjobs = Task.Task.process
|
||||||
Task.Task.process = process
|
Task.Task.process = process
|
||||||
Task.Task.lock_maxjob = lock_maxjob
|
Task.Task.lock_maxjob = lock_maxjob
|
||||||
Task.Task.release_maxjob = release_maxjob
|
Task.Task.release_maxjob = release_maxjob
|
||||||
Task.Task.wait_maxjob = wait_maxjob
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@ def configure(conf):
|
||||||
def build(bld):
|
def build(bld):
|
||||||
p = bld.srcnode.find_node('compute').abspath()
|
p = bld.srcnode.find_node('compute').abspath()
|
||||||
|
|
||||||
|
lockf = bld.srcnode.make_node('busy_lock.txt')
|
||||||
|
lockf.write('')
|
||||||
|
|
||||||
bld.jobs = JOBS = 3
|
bld.jobs = JOBS = 3
|
||||||
for i in range(JOBS):
|
for i in range(JOBS):
|
||||||
bld(rule='waf configure build -o test%d'%i, cwd=p, always=True)
|
bld(rule='waf configure build -o test%d'%i, cwd=p, always=True)
|
||||||
|
|
|
@ -53,7 +53,7 @@ def build(bld):
|
||||||
source = 'a.cpp',
|
source = 'a.cpp',
|
||||||
use = 'BOOST')
|
use = 'BOOST')
|
||||||
|
|
||||||
bld.program(
|
bld(features = 'cxx cxxprogram',
|
||||||
target = 'test1',
|
target = 'test1',
|
||||||
source = 'b.cpp c.cpp main.cpp',
|
source = 'b.cpp c.cpp main.cpp',
|
||||||
use = 'base-with-pch')
|
use = 'base-with-pch')
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue