Compare commits

...

480 Commits

Author SHA1 Message Date
Waf Project 149102f11f Argparse updates 2024-05-14 00:26:16 +02:00
Waf Project 4d0edd113a Print waf version 2024-05-12 02:20:25 +02:00
Waf Project 66a013ed28 waf-2.1.0
Signed-off-by: Waf Project <noreply@waf.io>
2024-05-02 00:03:48 +02:00
Waf Project bd5c22d484 Move from optparse to argparse 2024-04-28 00:35:28 +02:00
Waf Project a3fec9f0b3 Improve ldscript example 2024-04-21 06:59:27 +02:00
Waf Project e0dcfae373 Update c_nec and c_emscripten 2024-04-16 00:25:45 +02:00
Waf Project a7d05142c5 Update outdated playground examples 2024-04-07 19:34:00 +02:00
Waf Project 76f416ca14 Lock wafcache on non-posix systems 2024-04-01 17:02:15 +02:00
Waf Project 9f0773cfba Move wafcache optional imports 2024-04-01 11:18:07 +02:00
Waf Project ec63a7dd38 Change _add_task to add_task in Runner.py - part 2 2024-04-01 09:35:13 +02:00
swaldhoer 974d0589fd Minor docs improvement 2024-03-29 12:02:50 +01:00
Waf Project 39413bedfd Update playground/ldscript 2024-03-28 16:47:29 +01:00
Waf Project aef2c6ef23 Remove old Itanium references in msvc/ifort detection 2024-03-23 10:59:16 +01:00
Waf Project 456bd879bc Change _add_task to add_task in Runner.py 2024-03-23 10:58:59 +01:00
Waf Project 707b362685 Add the script path to OneApi Fortran compilers 2024-03-23 10:55:08 +01:00
Alibek Omarov 6e675dfc30 Configure: remove unused error_handlers
ConfigurationContext's error_handlers isn't used anywhere in the whole project,
and it's unknown how it should've been implemented
2024-03-09 12:21:02 +01:00
Waf Project d166646556 Reduce verbosity when both Qt5 and Qt6 are installed on a system
See aff9ec24a6
2024-03-09 12:16:56 +01:00
Federico Pellegrin a0b8f6a2a3 qt5: Revert pattern matching libraries as that breaks libs like QtX3D 2024-03-09 11:10:48 +01:00
Waf Project 761ed9beda Describe why color_gcc.py is no longer relevant 2024-03-09 11:10:41 +01:00
Waf Project ea1412b7e7 Avoid coloring all MSVC logs #2366 2024-03-09 11:10:34 +01:00
ita1024 53ca5a71ed Merge branch 'a1batross-waf-2.1-patch-93534' into 'waf-2.1'
extras: pthread: fix check for C mode with paranoid -Werror=old-style-declaration and -Werror=unused-variable

See merge request ita1024/waf!2365
2024-01-24 23:38:32 +00:00
Alibek Omarov 611cd30114 extras: pthread: fix check for C mode with paranoid -Werror=old-style-declaration and -Werror=unused-variable 2024-01-23 21:46:06 +03:00
Wynn Wilkes 84ba1e9da0 Fix possible crash in ctx.cmd_and_log() when verbose mode is on
- When waf is run with -v, and it runs a call to context.cmd_and_log() with an argument list,
  argument[0] is a relative path, and a cwd **kwarg is passed so that the argument[0] resolves
  correctly, then the call will crash saying the program could not be found. For example, the
  caller may be wrapping calls using a nodejs environment like:

  ctx.cmd_and_log("./node_modules/bin/webpack", cwd="webui")

  and this will fail with "Program ./node_modules/.bin/webpack not found!"
  if waf is run with -v. The user friendly check for usable programs still
  stays in place for shell calls and absolute paths, but allows the caller
  to use this pattern even when verbose mode is on. This same fix was
  previously made for context.exec_command().
2024-01-12 14:28:29 +01:00
Waf Project 01b4c03a84 Improve Qt6 detection with msvc 2024-01-12 14:13:07 +01:00
Waf Project 97a54d72da Typo 2024-01-12 14:10:54 +01:00
Waf Project 5122ef89f2 Fix exec_command & waf -v & custom path in environment 2023-12-10 22:43:52 +01:00
Wynn Wilkes 4a650f3455 Fix possible crash in ctx.exec_command() when verbose mode is on
- When waf is run with -v, and it runs a call to context.exec_command() with an argument list,
  argument[0] is a relative path, and a cwd **kwarg is passed so that the argument[0] resolves
  correctly, then the call will crash saying the program could not be found. For example, the
  caller may be wrapping calls using a nodejs environment like:

  ctx.exec_command("./node_modules/bin/webpack", cwd="webui")

  and this will fail with "Program ./node_modules/.bin/webpack not found!"
  if waf is run with -v. The user friendly check for usable programs still
  stays in place for shell calls and absolute paths, but allows the caller
  to use this pattern even when verbose mode is on.
2023-12-10 22:43:42 +01:00
Michael Vincent 20b04dd137 Improve msvc log output 2023-12-07 21:53:03 +01:00
Waf Project 266a75a4ef Switch to nonstopmode for latex prompts #2421 2023-12-07 21:14:05 +01:00
Björn Lindqvist 18192437a0 glib-mkenums is a Python script no need to check for perl 2023-10-21 10:47:05 +02:00
Waf Project 37808b3de4 Update the public key from the main branch 2023-10-21 10:36:54 +02:00
Waf Project d115501165 Duplicate the license to a file #2357
The license is in waf-light, but some people really want to have a file for it.
2023-10-21 10:17:57 +02:00
Björn Lindqvist 8b140fd541 Pass the args parameter through to parse_cmd_args 2023-10-21 10:05:03 +02:00
Waf Project 49231ab9ff Add macros for intel compiler detection (icx, icpx, ifx) 2023-10-21 10:04:38 +02:00
Dan Church 2689cc9518 Only detect binaries with execution permission
If for instance a program was in PATH and the file was marked
non-executable (`chmod -x`), `find_binary` it would still pick it up as
executable.
2023-10-21 10:04:05 +02:00
Waf Project 50644394f6 Detect new intel compilers (icx, icpx, ifx) 2023-09-26 22:40:09 +02:00
Björn Lindqvist f0b2fb9816 Fix crash in demos/asm
Crash is likely because gcc has become more strict in recent
version. To fix it I had to add the -no-pie flag and move mult10 to
the text section.
2023-09-26 22:39:40 +02:00
Waf Project dc5602608e Update the example that cleans any non-declared file #2415 2023-09-15 18:39:31 +02:00
Thomas Nagy 270a2e09b6 Update the documentation 2023-07-15 15:29:53 +02:00
ita1024 218da8fe28 Merge branch 'qt6-experimental2' into 'waf-2.1'
qt5: Add support for Qt6

See merge request ita1024/waf!2355
2023-07-15 11:05:10 +00:00
Rafaël Kooi 6c0a8c7c84 qt5: Add support for Qt6
Implements support for Qt6 by extending qt5.py. The user can opt in for
Qt6 support by setting cfg.want_qt6 = True. There's also a qt6 feature,
which at the moment is identical to the qt5 feature. Splitting has been
done now for futureproofing purposes. Qt6 libraries can be selected
through the cfg.qt6_vars variable. I didn't make an attempt at any
backwards compatibility by trying to load cfg.qt5_vars if it exists,
this is done so the move from Qt5 to Qt6 is a more deliberate process.

Signed-off-by: Rafaël Kooi <3961583-RA-Kooi@users.noreply.gitlab.com>
2023-06-22 19:08:28 +02:00
Alibek Omarov 2e8121f63f waflib: extras: msvs: enclose solution path into doublequotes in generated shell commands 2023-04-10 19:58:22 +02:00
ita1024 215de5f7d3 Merge branch 'waf-2.1' into 'waf-2.1'
Haxe Toolkit support

See merge request ita1024/waf!2352
2023-03-28 22:57:15 +00:00
Adam Barton 67dcb2b7f6 Haxe Toolkit support 2023-03-28 22:57:14 +00:00
Thomas Nagy d4f495bced Add Python 3.11 and 3.12 too 2023-03-28 01:21:30 +02:00
Alibek Omarov d7da1547f7 waf.bat fixes 2023-03-28 01:21:17 +02:00
Thomas Nagy ff0a8cec14 Support SOURCE_DATE_EPOCH in some places 2023-02-12 10:42:11 +01:00
Thomas Nagy 99bdb12a60 Add asynchronous wafcache uploads 2023-01-01 14:18:50 +01:00
Thomas Nagy 412c9e6b22 Fix suspicious warnings 2023-01-01 14:16:40 +01:00
Thomas Nagy c24ef5f3e6 Python3: install packages to "site-packages" (same as waf-2.0) 2022-12-31 10:19:18 +01:00
Thomas Nagy 69c95b5341 Provide a replacement for distutils.version.LooseVersion 2022-12-22 18:58:31 +01:00
Harald Klimach 240555a979 Adding an extra module to detect the Fujitsu Fortran compiler on ARM64FX. 2022-11-20 06:56:06 +01:00
Thomas Nagy e559bd08f2 Ensure find_program replaces more invalid characters 2022-11-20 06:55:13 +01:00
Thomas Nagy 698888f149 wafcache: skip uploads when inputs are modified while building 2022-10-02 01:51:02 +02:00
André Bauer af9a1a249d Fix typo in documentation. 2022-10-02 01:50:57 +02:00
Andrew Malachowski f69602d1df Improve cp65001 compat in cpython < 3.3 2022-10-02 01:50:50 +02:00
Federico Pellegrin fae5693f41 sphinx: support multiple output formats 2022-10-02 01:50:40 +02:00
Andrew Malachowski 23c975064e gccdeps: Harden class wrapping 2022-10-02 01:50:30 +02:00
Federico Pellegrin 78f49d44c8 pyqt5: improve autodetection of tools and add flag support
Improves autodetection by adding tool naming as found in some recent
distributions (ie. Fedora). Adds also possibility to pass via env
command line options to tools (needed ie. to explicitly pass
generator due to changes to uic/rcc tool).

Test updated to demonstrate and document the parameter needed to
work out of the box with newest tooling.
2022-10-02 01:50:23 +02:00
Thomas Nagy 7b912a0439 Ensure signed waf files can be created using Python3 2022-10-02 01:50:14 +02:00
Thomas Nagy 2a1eeba691 Sort visual studio versions by version number #2352 2022-05-22 11:30:52 +02:00
Alibek Omarov b91ef6a91b msvc: fix version detection when new and old compilers are installed 2022-05-22 11:30:34 +02:00
David Kassa b0ea8121e8 modernize macos demo 2022-05-19 00:46:03 +02:00
Thomas Nagy d7d5e9d2d6 docs: fix the inheritance diagrams in the apidocs 2022-05-17 23:54:58 +02:00
Thomas Nagy 5c90204a96 doc: fix the empty apidocs 2022-05-17 23:54:50 +02:00
Thomas Nagy 6b820ba879 docs: improve the featuremap's layout 2022-05-17 20:20:19 +02:00
Miro Hrončok b093e9eac7 Python: Use EXT_SUFFIX config var over the deprecated/removed SO
Fixes https://gitlab.com/ita1024/waf/-/issues/2386
2022-05-17 17:31:40 +02:00
ita1024 5d56dff596 Merge branch 'waf-2.1' into 'waf-2.1'
tools: c_tests: use stlib flag instead of shlib in check_endianness

See merge request ita1024/waf!2339
2022-05-14 22:21:10 +00:00
Francescodario Cuzzocrea 317e3e8579
tools: c_tests: use stlib flag instead of shlib in check_endianness
shlib is no-op in some baremetal newlib based toolchains (for example in
riscv one), and causes the check to fail as the --dynamic flag is not
recognized
2022-05-12 14:56:09 +02:00
Mathieu Parent 97302d9758 Add support for GNU/kFreeBSD
Where default compiler is gcc
2021-12-14 14:24:32 +01:00
Thomas Nagy 00c3cd31b6 Remove the 'check' target from eclipse.py because it is unused 2021-12-09 15:47:16 +01:00
Thomas Nagy 02d906f69a Avoid errors in case ECLIPSE_EXTRA_TARGETS is is set to None 2021-12-09 15:46:57 +01:00
Federico Pellegrin 41eb8ef35f eclipse: add possibility to add custom targets execution
Make it easy to add custom target executions in the automatic
eclipse configuration generation, for example to call other
standard waf targets from other tools or with specific options.
2021-12-09 15:44:30 +01:00
Thomas Nagy 8dc07cc533 Detect qt5 libraries in alphabetical order 2021-12-08 02:19:28 +01:00
Thomas Nagy 8ca3cbd277 Detect Qt3D* libraries #2368 2021-12-08 02:19:20 +01:00
Thomas Nagy d27e0bd271 Update the CI pipelines 2021-12-04 10:22:00 +01:00
Thomas Nagy 2bbee630cc Update the CI Pipelines for Python 2.7 2021-12-04 09:49:46 +01:00
Thomas Nagy f3c09355ef Update the CI pipelines 2021-12-04 09:38:20 +01:00
Federico Pellegrin 910133a5b6 wafcache: support stats also for multiple build commands 2021-11-24 20:42:26 +01:00
ita1024 065496a619 Merge branch 'waf-2.1-fix-python-tool' into 'waf-2.1'
Waf 2.1 fix python tool

See merge request ita1024/waf!2332
2021-09-30 19:30:49 +00:00
Morten V. Pedersen 59a9b24cf8 Waf 2.1 fix python tool 2021-09-30 19:30:49 +00:00
Federico Pellegrin 9c5945d85a eclipse: remove repeated entries in include paths for C/C++
Make sure just unique include paths (both system and local) are
added to prevent overcrowding with useless redundant include paths
that grow up a lot the generated XML file and make the usage of
the GUI messy.
The filter was already there for Java/Python.
2021-09-04 22:38:01 +02:00
Federico Pellegrin 229bf15ab2 eclipse: add generation of editor language settings
Add automatic generation of editor language settings for C and C++,
so the automatic code correction uses the correct compiler and
compiler flags, including for example the correct C/C++ standard
so construct from such standards are correctly managed by the IDE.
Correct compiler and flags are automatically generated using the
build environment data gathered during configure phase.
The playground example has been modified to contain some code that
is standard specific to demonstrate the new feature when run under
Eclipse.
2021-09-01 00:43:35 +02:00
Federico Giovanardi 664513aa44 Make clang_compilation_database compatible with variants
In the current implementation if a project is using
build variants it's not possible to use the clang_compilation_database
plugin because it strips the variant information from the build object.
2021-07-15 19:09:43 +02:00
Erik Parker 45bc50e523 color_gcc: Check that cmd has elements in it before processing it. 2021-07-15 19:09:24 +02:00
Thomas Nagy 9a60e7ed9e Process dependency Nodes in bld(rule=..., deps=[..]) 2021-07-15 19:09:18 +02:00
Thomas Nagy 95c2bc0702 Improve error messages from scanner errors #2356 2021-07-15 19:09:04 +02:00
Thomas Nagy 55d57d0b58 Handle deprecated Thread.setDaemon in Python 3.10 2021-05-13 17:12:40 +02:00
Thomas Nagy 747a339b7f Ensure ConfigurationContext.load/Context.load have the same interface (continued) 2021-05-13 17:02:31 +02:00
Thomas Nagy 86b1f0def1 Ensure ConfigurationContext.load/Context.load have the same interface 2021-05-09 10:32:16 +02:00
Thomas Nagy 2f248f78e2 Disable OpenIndiana from the pipelines 2021-05-06 21:48:46 +02:00
Thomas Nagy 58b58fb0ee On windows, try $INCLUDEPY/../libs to detect the Python library path 2021-05-06 21:48:39 +02:00
Federico Pellegrin 6ccfd6d704 swig: skip CR (\r) if present in module name
Handles presence of \r in module name (ie. DOS mode swig .i files)
Should fix #2350
2021-05-06 21:48:29 +02:00
Michael Vincent 22b72e167f gccdeps: Refactor cache lock
Rework how gccdeps' cached_nodes lock is used so acquiring the lock is
only necessary on a cache miss. Also use a "with" context manager to
simplify management of the lock lifecycle.

Ported from 8b5a2a2086
2021-05-06 21:48:18 +02:00
Michael Vincent bf97987991 gccdeps: Move scan() method
Move the scan() method down in the file to match msvcdeps' method
ordering. This makes it easier to compare gccdeps.py and msvcdeps.py
to keep them in sync.
2021-05-06 21:48:12 +02:00
Michael Vincent 30508f53c2 gccdeps: Rename some variables
Rename some local variables to clarify their purpose and to align with
msvcdeps.py.
2021-05-06 21:48:05 +02:00
Michael Vincent 615c32faef msvcdeps: Align with gccdeps
Just a few small changes to make msvcdeps.py align with gccdeps.py
better.
2021-05-06 21:47:53 +02:00
Michael Vincent e55b4b2375 msvcdeps: Remove unused variable 2021-05-06 21:47:45 +02:00
Thomas Nagy 67793aa173 Let msvcsdeps process relative paths and in a deterministic manner 2021-05-06 21:47:38 +02:00
Michael Vincent ba44704dbf msvcdeps: Faster case correction
Visual Studio returns paths to dependencies with incorrect case.
ant_glob() is very slow for this use case (40~50% impact to overall
build time). This patch uses os.listdir() to find the correct case
of each path component.
2021-05-06 21:47:28 +02:00
Alibek Omarov a82625297d c_config: add RISC-V generic detection 2021-04-15 17:30:54 +02:00
Erik Parker a23b3f5e9b winres: Pass include paths by environment variable 2021-04-05 22:04:23 +02:00
Erik Parker 68ff6f13b2 msvs: Update project sorting in visual studio solution file
In order to correctly set a default project in visual studio any folders
must be listed at the top of the solution file. This change ensures that
any folders included in generated solutions sort to the top of the .sln
file. The default project, if one exists, will be located after the
folders. Note that it should also be correct to place the default
at the top of the file, followed by any folders.
2021-03-13 07:11:17 +01:00
Thomas Nagy 28318c9cca Remove the method conf.add_as_needed because it does not check for the flag usage 2021-03-12 07:54:52 +01:00
Thomas Nagy bf5a825317 Work around faulty vcvarsall.bat scripts #2315 2021-01-30 16:22:55 +01:00
Bootsma, James ca3ca0591e waf_unit_test: Fix command handling under windows
The unit test tool moved from a simple split to using shlex.split for
handling the unit test command. This results in the path separators on
windows being treated as escapes.

To handle this the unit test exec command is properly escaped before
joining so that the subsequent split restores the original arguments.
The quote function is also exposed in the Utilities module so that
wscripts making use of the unit test tool can properly quote their
contributions to the command as well.
2021-01-21 18:51:47 +01:00
Thomas Nagy ff8c1828aa Allow mixing Unix paths with destdir on non-Unix platforms 2021-01-19 20:52:57 +01:00
Thomas Nagy b864388e12 Fix Build.py indentation 2021-01-19 17:51:01 +01:00
Thomas Nagy da5769172b Add more docs to clang_compilation_database 2021-01-19 17:50:56 +01:00
Thomas Nagy 0d0aa45d0b Increase clang_compilation_database and swig compatibility 2021-01-19 17:14:58 +01:00
Thomas Nagy e0c16b3ada Suppress cache trimming operation errors 2021-01-19 17:14:52 +01:00
Federico Pellegrin a8469f49d8 wafcache: fix reporting of concurrent trim error
As this is run in the non-waf process we don't have Logs, so we
write to stderr instead or we will get a NameError name 'Logs' is
not defined.
2021-01-11 23:39:45 +01:00
Federico Pellegrin 236e6a7945 cuda: pass correctly compiler options from nvcc to the underlying compiler with --compiler-options 2021-01-09 01:28:32 +01:00
Federico Pellegrin d17780bc6b cuda: solve warnings due to testapp being created by two tg 2021-01-09 01:28:24 +01:00
Federico Pellegrin 1d722360be wafcache: fix small typo on stats log message 2021-01-09 01:26:58 +01:00
Thomas Nagy a296b4119e Do not detect Qt6 when detecting Qt5 2020-12-26 20:43:37 +01:00
Federico Pellegrin 54464f0a20 wafcache: add simple cache statistics collection, configurable via env 2020-12-26 20:24:57 +01:00
ita1024 8a0850dd89 Merge branch 'waf-2.1' into 'waf-2.1'
Haxe support

This commit adds support for haxe over [lix](https://github.com/lix-pm/lix.client) toolkit
- haxe library validation: check and fetch missing libs if needed
- "haxe" loader with "hx" compiler
- HAXEFLAGS
- lib checking and uselib_store support
- ctx.haxe with `res` argument to be more simple
- error checking

See merge request ita1024/waf!2308
2020-12-23 20:38:58 +00:00
Andrew Brodko 5841a8571e Haxe support 2020-12-23 20:38:58 +00:00
Thomas Nagy 1e729ba345 Work around distutils MACOSX_DEPLOYMENT_TARGET regression #2330 2020-12-17 14:18:33 +01:00
Thomas Nagy a74d40a505 Improve clang_compilation_database interaction with wafcache 2020-12-15 13:07:47 +01:00
Thomas Nagy 6ed66ce90b Reduce wafcache verbosity on cleanup operations 2020-12-15 11:06:05 +01:00
Thomas Nagy 6a5753da93 Conceal wafcache decoding errors in Python3 2020-12-15 10:58:00 +01:00
Thomas Nagy b7c7ffccab Fix the file_to_object example 2020-12-09 08:21:19 +01:00
Thomas Nagy 81bb79ab3d Update the project's public key 2020-12-09 08:21:02 +01:00
Thomas Nagy 3af7222fa0 Improve the WAFCACHE_CMD description 2020-12-09 08:20:32 +01:00
Thomas Nagy 4219f0822c Reduce verbosity in out-of-tree builds 2020-12-09 08:20:21 +01:00
Thomas Nagy 4e61e3a563 Improve WAFCACHE_CMD parameter handling 2020-12-09 08:20:07 +01:00
Federico Pellegrin 5584d1e687 wafcache: make the extra more configurable for cloud providers usage 2020-12-09 08:19:58 +01:00
Thomas Nagy b41f13b3a0 Exclude wafcache symlink handling
- Exclude classes having folder or symlinks
- Exclude well-known Task classes from wafcache processing
- Remove stale 'waflib.Task.Task.chmod' processing
2020-12-08 22:00:52 +01:00
Federico Pellegrin d1eb41f944 wafcache: add support for MinIO/mc cache
Add support for MinIO object storage (https://min.io/) using the
MinIO client (https://github.com/minio/mc) to wafcache.

MinIO is an open-source, self-hostable, S3 compatible cache. The
MinIO client supports MinIO connections as well as normal S3/GCS
storages by configuring aliases beforehand.

Hint: some distributions have `mc` (the GNU Midnight Commander)
installed which is not the minio client, be aware of this (or your
build may get stuck with waf waiting for `mc` to never finish)
2020-11-02 17:50:13 +01:00
Federico Pellegrin 9cd8a801c7 waf_unit_test: consider ut_cmd always for task signature 2020-11-01 21:20:02 +01:00
Thomas Nagy 6f8828dc3a Force unit test re-runs on environment or command changes 2020-11-01 21:19:56 +01:00
Federico Pellegrin 47d097d5a0 waf_unit_test: make sure test is rerun if ut_str changes 2020-11-01 21:19:38 +01:00
Thomas Nagy cc03657db7 Invalidate previous configurations on "waf configure"
Previously-configured projects are now invalidated when
running "waf configure" so that subsequent builds
cannot continue.
2020-09-19 10:38:05 +02:00
Thomas Nagy 2b03690f02 The lrelease program is necessary, not lupdate 2020-09-19 10:09:45 +02:00
Thomas Nagy e73e8d680a Fail Qt5 detection immediately when the c++ compiler is missing 2020-09-19 08:49:05 +02:00
Thomas Nagy 3b41d92e3c Make sure lupdate is explicitly required 2020-09-19 08:40:44 +02:00
Dotan Cohen 6fba8d3742 Update tutorial.rst to clarify that the env attribute is shared between the cnf and bld parameters to their respective methods. 2020-09-06 20:00:37 +02:00
Dotan Cohen 2831c75093 Update tutorial.rst to use uniform parameter names in all places where the configure() method or its parameter is mentioned. 2020-09-06 20:00:29 +02:00
Thomas Nagy ea509dd782 Determine a suitable msvc version option from VSCMD_VER in environment
See b3d1a0c2d4
2020-08-19 23:54:04 +02:00
Thomas Nagy 025ba60ebf Force an asm-specific defines flag 2020-08-15 12:16:36 +02:00
ita1024 ccfe1fc19c Merge branch 'FixClangCL' into 'waf-2.1'
Fix configuration fail on Windows with clang-cl module when not using the llvm.org release

See merge request ita1024/waf!2298
2020-08-14 06:36:40 +00:00
3961583-RA-Kooi@users.noreply.gitlab.com 1f92d020e7 Fix configuration fail when using portable LLVM on Windows 2020-08-13 20:54:19 +02:00
Thomas Nagy 35b60bed61 Remove an extra 'pch' annotation in playgroud/pch/wscript 2020-08-10 21:23:16 +02:00
Thomas Nagy 43ce688cdf Fix playground/pch's second example 2020-08-10 21:23:09 +02:00
Thomas Nagy a168e28ec8 Port file_to_obj to Python3 2020-08-03 23:30:33 +02:00
Thomas Nagy f65d08f5d5 Improve wafcache process pre-allocation 2020-08-03 23:20:53 +02:00
Thomas Nagy b41b1741d1 Improve the definition of static link tasks 2020-07-20 22:51:24 +02:00
Alibek Omarov 260f6065b9 c_config: add MCST Elbrus detection 2020-07-20 22:37:51 +02:00
Matt Selsky 778c7ad74c Typo 2020-07-20 22:37:40 +02:00
Thomas Nagy e21aead3b3 Conceal gccdeps/msvcdeps errors on inaccessible/unreadable files 2020-07-20 22:37:34 +02:00
Thomas Nagy 05198a8302 gccdeps/msvcdeps: renaming a header must rebuild silently #2293 2020-07-20 22:37:28 +02:00
Thomas Nagy cd589cd86b Update c_dumbpreproc (broken) 2020-07-20 22:37:18 +02:00
Andreu Montiel 988542e500 Allow parameter "always" in doxygen tool (waflib/extra/doxygen.py) 2020-07-20 22:37:00 +02:00
Johan Pauwels cc11c1dec1 Escape quoted strings in Xcode project 2020-07-20 22:36:39 +02:00
Johan Pauwels 668392f9fb Export preprocessor macros in Xcode project 2020-07-20 22:36:28 +02:00
Johan Pauwels f67f175c39 Fix configuration of linker flags in Xcode file 2020-07-20 22:36:14 +02:00
Johan Pauwels 84e71c9408 Fix alignment in generated Xcode file 2020-07-20 22:35:57 +02:00
Johan Pauwels 495b7c0e04 Xcode6 py3 fix.
The return type of .keys() in Python 3 is no longer a list, but a 
'dict_keys', which does not support the '+' operator.
2020-07-20 22:35:41 +02:00
Federico Pellegrin 0c843e5d40 sphinx: fix installation phase (as generated files are unknown until build) 2020-07-20 22:35:28 +02:00
Thomas Nagy 14b7d15a03 Ensure that the assertion message is showed in python.py #2302 2020-07-15 17:35:22 +02:00
Thomas Nagy 6c99c7cb0b Add a configuration test for pthread detection #2264 2020-05-02 21:04:28 +02:00
Federico Pellegrin 5ee61cfa91 qt5: improve documentation on library detection and options 2020-05-02 19:09:43 +02:00
Michael Vincent d3c0017d21 msvcdeps: Tweak debug output
Print out which source file waf is gathering dependencies for and leave
the leading spaces in the dependency debug output because it can be
helpful to see the dependency hierarchy.
2020-05-02 19:09:34 +02:00
Mathieu Courtois 2a6817fa1c boost: ignore version number from library name 2020-05-02 19:09:22 +02:00
Thomas Nagy a910d07d55 Make the unit test result format API compatible with waf 2.0 2020-04-28 01:17:07 +02:00
ita1024 b599c8bb9d Merge branch 'waf_unit_tg' into 'waf-2.1'
waf_unit_test: return also task generator in report tuples

See merge request ita1024/waf!2285
2020-04-27 22:56:38 +00:00
Federico Pellegrin 04e586b28a waf_unit_test: correct also demos/playgrounds with addition of ut_task change 2020-04-24 08:52:01 +02:00
Federico Pellegrin ba9ddfbfcb waf_unit_test: return also test task in report tuples 2020-04-22 03:55:38 +02:00
Mathieu Courtois 186f627203 boost: fix removal of lib extension 2020-04-09 16:55:14 +02:00
Federico Pellegrin 0c616901b4 c_config: -flto and -fno-lto need to be passed also when linking 2020-03-27 20:20:30 +01:00
Thomas Nagy 4f8099fbdc Improve custom option processing #2280 2020-03-27 20:20:22 +01:00
swaldhoer 93a0258996 Add support for clang++ on cygwin 2020-03-27 20:20:12 +01:00
Thomas Nagy 4bfab7f926 Remove the accidental gccdeps requirement 2020-03-27 20:20:00 +01:00
swaldhoer 02cff4a20c add support for clang on cygwin 2020-03-27 20:19:49 +01:00
Michael Vincent b7549d33ed gccdeps: Add support for gas
Add support for generating and using gcc's native dependency files with
the GNU Assembler in addition to the existing C/C++ support.

When the gas and gccdeps tools are loaded, the configure step will test
whether gcc operating on an assembly file supports the -MMD argument.
If so, waf will pass the -MMD argument to .S files assembled with gcc
which will cause it to generate .d dependency files. Waf will then parse
those files for dependency information.

Note: This will only work for assembly files compiled through the gcc
frontend, not with GNU as directly. It also requires assembly files to
use the uppercase .S file extension.
2020-03-27 20:19:35 +01:00
Federico Pellegrin 405c322489 doxygen: add ext_int to force build ordering 2020-03-27 20:19:25 +01:00
Federico Pellegrin 0c855b0aa2 javatest: add dependency management for jar/java taskgens 2020-01-04 11:31:25 +01:00
Federico Pellegrin c438138476 javaw: fix buglet overwrites working variable while adding dependencies
variable x is used in the outer loop and gets corrupted by inner enumeration in case of non-jar dependency

to reproduce: use the demos/java and run waf build twice: the first time will work (since no class files around)
while the second will not since will by bad luck pick a class file in the inner loop
2020-01-04 11:31:15 +01:00
Morten V. Pedersen 3204e2597c Using suggested self.cmd.startswith approach 2020-01-02 19:58:25 +01:00
Morten V. Pedersen 058b5d3793 Fix detection of build context when a custom context is used 2020-01-02 19:58:18 +01:00
Thomas Nagy ce2e5ca9a2 Exclude ConfigSet from altering ConfigurationContext.run_build caches #2273 2019-12-20 07:57:20 +01:00
Thomas Nagy 13d9c8566c Reduce relative path lengths to work around Visual Studio limitations #2272 2019-12-18 07:27:03 +01:00
Thomas Nagy 07d3203e0b
Make multicheck collisions less likely 2019-12-14 23:49:24 +01:00
Thomas Nagy 35617abe5e Remove another sys.platform == win32 2019-12-11 19:51:49 +01:00
Thomas Nagy 015a51a7cf Split llvm-lib path discovery into its own function 2019-12-11 07:42:02 +01:00
Thomas Nagy 52a49960c1 Improve extras/clang_cl 2019-12-10 07:53:23 +01:00
Adriano Scoditti e3c275a96a Make distclean target 'no_lock_in_top/run' modifiers compatible with env vars 2019-12-10 07:32:16 +01:00
Thomas Nagy bab51bf9f4 Remove conf.find_cpp from irix compiler detection 2019-12-10 07:32:08 +01:00
Thomas Nagy 5ec740ad2e Update irixcc 2019-12-10 07:32:01 +01:00
ita1024 73d432eb0a Merge branch 'clang_cl2' into 'waf-2.1'
Clang-cl support

See merge request ita1024/waf!2273
2019-12-10 06:29:06 +00:00
Rafaël Kooi c4f18f8182 Add a ReadMe and example environment for clang-cl on Linux 2019-12-10 05:07:35 +01:00
Rafaël Kooi 273d9dbe73 Add a small example utilizing clang-cl 2019-12-10 05:07:35 +01:00
Rafaël Kooi 32c2a49bf0 Support pure clang-cl builds on not Windows
A.k.a. I just tested it on Linux.
2019-12-10 05:07:35 +01:00
Rafaël Kooi 7310ade7c3 Initial clang-cl support 2019-12-10 05:07:35 +01:00
Rafaël Kooi 9fee4dfa75 Ignore VIM temporary files and Windows waf unpacks 2019-12-10 04:55:31 +01:00
Severin Strobl 799001bfae Support versioned shared libraries.
Shared libraries often use a suffix encoding their version which should
be handled when parsing linker flags.
2019-11-24 09:07:58 +01:00
Thomas Nagy d97ac90419
Improve the Qt5 fPIC/fPIE detection 2019-11-16 18:47:34 +01:00
Thomas Nagy b27afc7bbc
Use task.get_cwd() in clang_compilation_database 2019-11-10 19:01:38 +01:00
ita1024 11f449ee57 Merge branch 'FixTypo' into 'waf-2.1'
Add back an accidentally deleted line clang_compilation_database.py

See merge request ita1024/waf!2269
2019-11-10 14:49:14 +00:00
Rafaël Kooi 5343e8547a Add back an accidentally deleted line clang_compilation_database.py 2019-11-10 15:45:36 +01:00
Thomas Nagy 394f3cdac8
Typo 2019-11-10 12:34:36 +01:00
Thomas Nagy 16dbeb73e8
Fix relative path comparisons in clang_compilation_database 2019-11-10 12:32:20 +01:00
Thomas Nagy 38b6f24d73
Update msvc_pdb.py from the master branch 2019-11-10 10:41:25 +01:00
Thomas Nagy e485b45472 Remove the dependency on Qt5Gui in the Qt5 detection 2019-11-10 10:39:39 +01:00
Federico Pellegrin 26309403fd Tools/c_config.py: update to documentation 2019-11-07 07:07:44 +01:00
Alibek Omarov 261a589a66 msvc_pdb: check compiled_tasks existence, so it will not misleadingly throw a stacktrace if no sources was added 2019-11-04 21:26:29 +01:00
Federico Pellegrin 64b74c7659 playground/swig: clean up java swig example 2019-11-04 21:26:13 +01:00
Thomas Nagy 142fe5016a
The future version will be 2.1.0 2019-11-03 10:45:20 +01:00
Thomas Nagy 4e171c87ad
Improve os.environ propagation #2264 2019-11-03 10:24:13 +01:00
Thomas Nagy b8f19bfea3 Improve cache activity verbosity 2019-10-29 07:31:41 +01:00
Thomas Nagy a6ff2fc274
Push wafcache files synchronously for now 2019-10-23 19:53:18 +02:00
Thomas Nagy 6ef3a95c48 Insert the classpath dependencies from other task generators in first position #2186 2019-10-23 07:39:03 +02:00
Rafaël Kooi dbc66d19ba [MSVC/Fortran] Add /Fd flag when /Zi or /ZI flags are detected
Fixes #1731
2019-10-22 07:25:31 +02:00
Thomas Nagy f93cd67b14
Remove WinCE detection from msvc.py 2019-10-20 08:23:36 +02:00
Thomas Nagy 4aaadc1320
Remove Winphone detection 2019-10-20 07:45:02 +02:00
Thomas Nagy 5041a862fb
Propagate ldflags to fortran tasks #2262 2019-10-20 07:39:11 +02:00
Thomas Nagy dbe338c246
Make wafcache a default module 2019-10-18 23:05:12 +02:00
Thomas Nagy 959d57b757
Remove the metaclass hierarchy in Python 2 2019-10-18 23:02:19 +02:00
Thomas Nagy 1068ff98ec
Waf file creation will now require Python 3 2019-10-17 20:05:48 +02:00
Thomas Nagy fbee1a19d2
Tune the application name on --help #2254 2019-10-14 07:59:40 +02:00
Thomas Nagy 6539bd1ad3
Improve error messages in c_aliases 2019-10-08 20:04:00 +02:00
Thomas Nagy 2758fb3f7c Silently ignore negative values for -j 2019-09-26 21:50:18 +02:00
ita1024 f7cfcce157 Merge branch 'swig_pg_1' into 'master'
swig playground: fix build for Python 3.x

See merge request ita1024/waf!2259
2019-09-13 22:25:28 +00:00
ita1024 a56186637c Merge branch 'pytest_njd' into 'master'
pytest: add handling also of java dependencies via CLASSPATH (ie. JEP/Jython)

See merge request ita1024/waf!2258
2019-09-13 22:24:55 +00:00
ita1024 39b92903e3 Merge branch 'javatest_njd' into 'master'
javatest: manage environment also for non-java dependencies (ie. JNI / JEP)

See merge request ita1024/waf!2257
2019-09-13 22:24:28 +00:00
Federico Pellegrin 02c3711e2e javatest: manage environment also for non-java dependencies (ie. JNI / JEP) 2019-09-13 22:24:28 +00:00
Federico Pellegrin 3969482777 swig playground: fix build for Python 3.x 2019-09-13 09:23:39 +02:00
Federico Pellegrin 7ab507c799 pytest: add handling also of java dependencies via CLASSPATH (ie. JEP/Jython) 2019-09-10 09:55:17 +02:00
Thomas Nagy 68bf3867df
Unbreak the endianness test with msvc 2019-09-08 22:51:09 +02:00
ita1024 57ee25f844 Merge branch 'clang-db' into 'master'
clang_compilation_database: fix #2247, add clangdb command to generate database by request without rebuilding, add tests (WIP)

Closes #2247

See merge request ita1024/waf!2256
2019-09-08 20:05:37 +00:00
Alibek Omarov b8fd6a0515 clang_compilation_database: fix #2247, add clangdb command to generate database by request without rebuilding, add tests (WIP) 2019-09-08 20:05:37 +00:00
Thomas Nagy 4389e4400e
Add WAFCACHE_NO_PUSH to extras/wafcache 2019-09-01 09:31:07 +02:00
Thomas Nagy aece9b5e4b Enable wafcache remote servers 2019-08-25 22:31:12 +02:00
Thomas Nagy 397432f81e Simplify the Python examples 2019-08-14 22:20:01 +02:00
Thomas Nagy d2060dfd8a Conceal imp warnings in Python3 2019-08-14 22:05:45 +02:00
Thomas Nagy 0c0916ebdb
Add a new file-based waf cache implementation 2019-08-01 21:23:46 +02:00
Thomas Nagy 2793fb7dbb
Improve endianness detection 2019-07-31 21:04:53 +02:00
Thomas Nagy 4a79f95aa4
Disable lto for the endianness configuration test #2250 2019-07-30 18:45:07 +02:00
Thomas Nagy ea17399be6
waf-2.0.18 2019-07-14 10:44:58 +02:00
Thomas Nagy 314689b899
IronPython is broken 2019-07-11 19:52:03 +02:00
Thomas Nagy 88a0778476
Update the environment to IronPython 2.7.9 2019-07-11 19:13:14 +02:00
ita1024 a91bb8fa63 Merge branch 'doxygen_order_fix' into 'master'
Fix doxygen task-gen. pars input before processing

See merge request ita1024/waf!2255
2019-07-11 16:58:08 +00:00
Thomas Nagy bbaa976ae0
Add executable arguments for configuration tests / execute=True
conf.check(..., execute=True, test_args=['--abc=def'])
2019-07-11 07:55:38 +02:00
Thomas Nagy 88fa1fab83
Make the configuration cache more accurate #2251 2019-07-08 19:23:50 +02:00
Philipp Spilger ab167f687d Fix doxygen task-gen. pars input before processing
* OUTPUT_DIRECTORY now is created for a present parameter in `pars`
  of the task.
2019-07-05 10:38:10 +00:00
ita1024 fbe75085c6 Merge branch 'genpybind' into 'master'
Add 'genpybind' feature

See merge request ita1024/waf!2244
2019-07-02 10:46:22 +00:00
Yannik Stradmann 1fd2e4174c Add genpybind example 2019-07-02 12:15:18 +02:00
David Stöckel 0c16ab4f65 Set resource-dir explicitly for genpybind-parse 2019-07-02 10:46:34 +02:00
Johann Klähn cc20b414b3 Add genpybind feature 2019-07-02 10:46:34 +02:00
Thomas Nagy 190555a8d6 Add a testcase for #2244: deadlock with cython+subst tasks 2019-06-28 08:47:33 +02:00
Thomas Nagy 8cf982a766 Fix a deadlock with cython+subst tasks #2244 2019-06-27 09:38:49 +02:00
Thomas Nagy 3c75c6eccb Ensure waf-light is first in sys.path (Pip integration) 2019-06-27 08:38:33 +02:00
ita1024 ba3135c52b Merge branch 'pip_integration' into 'master'
Pip integration

See merge request ita1024/waf!2253
2019-06-27 06:36:48 +00:00
Adriano Scoditti dff204fad4 Move setup.py in subdir to unclutter the project root 2019-06-26 16:13:55 +02:00
Adriano Scoditti 56f3723a86 Removing the incorrect License description 2019-06-26 15:37:45 +02:00
Thomas Nagy 2e9954e087 Add a dependency scanner for gas/yasm and nasm (incomplete) 2019-06-26 15:00:03 +02:00
Adriano Scoditti da37dfb7a9 Adds script section to install waf-light bin and make it look for waflib in PYTHONPATH 2019-06-26 14:40:20 +02:00
Adriano Scoditti 5877a15ece Waf Pip integration through a setup.py in root 2019-06-26 14:40:20 +02:00
ita1024 bdb4dd90f6 Merge branch 'distclean_no_locks_aware' into 'master'
Do not clean lock files in top and run dirs if no-lock opts are set

See merge request ita1024/waf!2252
2019-06-26 10:46:33 +00:00
Thomas Nagy 770910fcda Detect of assembly features in bld.program()/bld.shlib() 2019-06-26 12:03:29 +02:00
Thomas Nagy 05252b85df Fix PIE errors in demos/asm/ 2019-06-26 11:51:56 +02:00
Adriano Scoditti 9e59917ee0 Do not clean lock files in top and run dirs if no-lock opts are set 2019-06-26 11:33:46 +02:00
Thomas Nagy b7a6114ac7 Limit fast_partial.py failures on configuration tests 2019-06-25 11:53:00 +02:00
Thomas Nagy 173f410e3f Improve the configuration cache accuracy 2019-06-25 11:51:44 +02:00
Thomas Nagy 9b3ab4b874 Improve fast_partial compatibility #2240 2019-06-23 08:45:18 +02:00
Thomas Nagy 497b875a89 Add -fno-strict-aliasing flags only if missing
https://gitlab.com/ita1024/waf/merge_requests/2248/diffs
2019-06-20 23:14:51 +02:00
ita1024 0178e6a692 Merge branch 'python_flat_install' into 'master'
Allow for flat install of python files via `py` feature

See merge request ita1024/waf!2249
2019-06-20 17:18:55 +00:00
Yannik Stradmann 8353c5ebfb Add demo for nested/flat python file installation 2019-06-19 23:46:27 +02:00
Eric Müller e319a9c2c9 Allow for flat install of python files via `py` feature 2019-06-19 22:33:36 +02:00
ita1024 e9498c9ad7 Merge branch 'cross_prefix_objcopy' into 'master'
Use cross_prefix option for objcopy if available

See merge request ita1024/waf!2247
2019-06-19 20:29:27 +00:00
ita1024 3b14e8f513 Merge branch 'rpath_fix' into 'master'
Fix local_rpath tool

See merge request ita1024/waf!2246
2019-06-19 20:25:07 +00:00
Eric Müller 97ab1e5a52 Use cross_prefix option for objcopy if available 2019-06-19 22:15:03 +02:00
Eric Müller 68ec2057b9 Fix local_rpath tool 2019-06-19 22:03:59 +02:00
ita1024 d536d3ebab Merge branch 'javaw_outdir_type' into 'master'
javaw: bugfix outdir is always a node (since converted in apply_javac)

See merge request ita1024/waf!2242
2019-06-06 22:16:15 +00:00
Federico Pellegrin fc0f5c86fd java demo: add test case for !2242 2019-06-06 20:33:43 +02:00
Thomas Nagy 1ade97f5c3
Add a configuration test for: "qt5 demo: add example of unit testing using QtTest" 2019-06-06 17:57:33 +02:00
Thomas Nagy 9df72c7898
Rework "qt5 demo: add example of unit testing using QtTest" 2019-06-06 16:45:24 +02:00
Thomas Nagy 82afd0a0e4
Rework "qt5 demo: add example of unit testing using QtTest" 2019-06-06 16:37:19 +02:00
fedepell 31c51501d7 javaw: bugfix outdir is always a node (since converted in apply_javac) 2019-06-06 15:06:41 +02:00
ita1024 31da55afb9 Merge branch 'qt5_unit_test' into 'master'
qt5 demo: add example of unit testing using QtTest integrated into waf

See merge request ita1024/waf!2241
2019-06-05 17:21:51 +00:00
fedepell e6eca1eec5 qt5 demo: add example of unit testing using QtTest integrated into waf with standard waf_unit_test Tool 2019-06-05 14:59:26 +02:00
Thomas Nagy 36898e12af
waf-2.0.17 2019-06-02 09:45:17 +02:00
Thomas Nagy 3e605feb72
Ensure that 'waf test' raises a meaningful error message in the installation test 2019-06-02 09:25:16 +02:00
Thomas Nagy fa6496dbc4
Use a constant instead of a hard-coded number (Qt5) 2019-06-02 09:23:57 +02:00
Thomas Nagy 36a0c12b3b
Rework installation colors 2019-06-02 09:20:29 +02:00
Thomas Nagy 6bc6cb599c
Refactor javaw.py 066a051181 2019-06-02 08:50:06 +02:00
Thomas Nagy 66fafd876a
Improve Qt5 processing 1de43d82c0 2019-06-02 08:43:19 +02:00
ita1024 387f01750c Merge branch 'javac_dep_robust' into 'master'
javaw: make dependencies code introduced in !2232 more robust

See merge request ita1024/waf!2239
2019-06-02 06:39:50 +00:00
ita1024 1de43d82c0 Merge branch 'qt5_partial_target' into 'master'
qt5: ignore moc generation on uninstall target

See merge request ita1024/waf!2240
2019-06-02 06:38:07 +00:00
fedepell a2589b9ed4 qt5: ignore moc generation on uninstall target 2019-06-02 00:57:33 +02:00
fedepell 066a051181 javaw: make dependencies code introduced in !2232 more robust 2019-05-28 11:40:43 +02:00
ita1024 e902e7a505 Merge branch 'add-missing-colors-on-install' into 'master'
Colors were missing when file already exists

See merge request ita1024/waf!2238
2019-05-27 19:14:18 +00:00
Morten V. Pedersen 1da4160b47 Colors were missing when file already exists 2019-05-27 19:14:18 +00:00
Thomas Nagy 14b6f47a24
Do not attempt to close fds on Windows platforms 2019-05-27 18:31:34 +02:00
Thomas Nagy 92e9764f58
Optimize sub process startup with workers 2019-05-27 18:05:02 +02:00
ita1024 503b09c984 Merge branch 'sphinx' into 'master'
sphinx: adds a tool for Sphinx documentation.

See merge request ita1024/waf!2237
2019-05-27 04:25:58 +00:00
Piotr Szubiakowski f547a5f932 sphinx: adds an example to the playground. 2019-05-26 13:37:34 +02:00
Thomas Nagy 8f0dd7c0b6
docs #2240 2019-05-26 12:20:34 +02:00
ita1024 d172c960e2 Merge branch 'patch-1' into 'master'
Fix waf.bat ERRORLEVEL to return actual exit code of waf

See merge request ita1024/waf!2235
2019-05-25 11:05:41 +00:00
ita1024 537af7f9f5 Merge branch 'python38' into 'master'
Python 3.8 has different flags for pyembed, needs --embed

Closes #2239

See merge request ita1024/waf!2236
2019-05-25 10:57:17 +00:00
Piotr Szubiakowski 3ef3f3f39c sphinx: adds a tool for Sphinx documentation.
Signed-off-by: Piotr Szubiakowski <pkszub@gmail.com>
2019-05-24 14:29:35 +02:00
Miro Hrončok 38d1cbeba4 Python 3.8 has different flags for pyembed, needs --embed
As recommended in the docs, to support both 3.8 and
previous versions, we try to use python3-config --embed and
fallback to the previous behavior.

Fixes https://gitlab.com/ita1024/waf/issues/2239

See https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build
2019-05-24 11:49:58 +02:00
Alibek Omarov 4e307d3b50 Fix waf.bat ERRORLEVEL to return actual exit code of waf 2019-05-23 22:47:51 +03:00
ita1024 b1ac2bc686 Merge branch 'update-install-colors' into 'master'
Update colors of install step

Closes #2238

See merge request ita1024/waf!2234
2019-05-17 05:46:17 +00:00
Morten V. Pedersen 396117b4dd Update colors of install step 2019-05-17 05:46:17 +00:00
Thomas Nagy c295c0bcda
waf-2.0.16 2019-05-15 23:54:47 +02:00
Thomas Nagy 8cbc8da5ce
Undo parentheses escaping in ant_glob 2019-05-10 23:13:01 +02:00
ita1024 89146d9030 Merge branch 'ClangCross' into 'master'
Better support for cross compilation with clang v2

See merge request ita1024/waf!2233
2019-05-10 05:50:55 +00:00
Dragoon 1581e221b4 Add a simple example for using Clang as a cross compiler for MSVC 2019-05-10 00:30:58 +02:00
Dragoon 6154a8de60 Better support for cross compiling with Clang 2019-05-10 00:30:58 +02:00
ita1024 96015a3053 Merge branch 'msvcdeps-case' into 'master'
msvcdeps: correct case of include paths

See merge request ita1024/waf!2228
2019-05-09 05:05:39 +00:00
Michael Vincent 9caad8c3ba msvcdeps: use ant_glob() to get correct case of include paths
When using msvcdeps, header dependencies are not detected reliably for
generated source files. The root cause is a bug in versions of MSVC
prior to VS2019 16.0 in which it emits lower-case path prefixes when
resolving include paths relative to the containing file. Absolute paths
and paths relative to include directories passed in the MSVC command
line are, in contrast, case-correct.

Such a file-relative include directive with an incorrect lower-case
prefix derails waf's node hash signature handling and fails silently.

This change uses ant_glob() with the ignorecase keyword argument to
find the file on the filesystem with the correct case. The prior
case-correction code has been superseded and was removed.

See the following Visual Studio bug report for details on the issue:
https://developercommunity.visualstudio.com/content/problem/233871/showincludes-lowercases-some-path-segments.html
2019-05-08 17:22:00 -05:00
Michael Vincent 7c362340af msvcdeps: remove path_to_node()'s path list support
Make path_to_node() only accept a path as a string instead of also as a
list. That requires joining the list of path components in the relative
path case before calling path_to_node(). Also use path.pop(0) to remove
the first path component instead of copying the remainder of the path
using a slice operator.
2019-05-08 17:22:00 -05:00
Michael Vincent 8b5a2a2086 msvcdeps: refactor cache lock
Rework how msvcdeps' cached_nodes lock is used so acquiring the lock is
only necessary on a cache miss. Also use a "with" context manager to
simplify management of the lock lifecycle.
2019-05-08 17:22:00 -05:00
Michael Vincent e874342103 Node: escape parentheses in ant_glob()
ant_matcher() converts an ANT glob pattern to an equivalent regex
pattern. This commit adds support for escaping parenthesis in the
input pattern so they don't end up being treated as a regex capture
group.

Also add a unit test to verify ant_glob()'s ability to handle special
characters in the input pattern.
2019-05-08 17:22:00 -05:00
ita1024 afa0dd15df Merge branch 'java_deps_1' into 'master'
javaw: set dependency between javac task and use-d generated jars nodes

See merge request ita1024/waf!2232
2019-05-08 05:18:43 +00:00
Federico Pellegrin b45634d380 javaw: add node dependencies for non-jar tasks to all generated class files 2019-05-08 05:18:31 +02:00
Federico Pellegrin b22b5636e9 javaw: also when using non-jar CLASSPATH has to be populated to use-d tasks. In this case we point to the directory instead of the JAR file 2019-05-08 05:06:29 +02:00
fedepell d9babce4ce javaw: set dependency between javac task and use-d generated jars nodes 2019-05-07 14:42:39 +02:00
ita1024 0a61596679 Merge branch 'protoc-java-cdir' into 'master'
protoc: make sure output directory exists for java

See merge request ita1024/waf!2231
2019-05-06 16:15:50 +00:00
fedepell 1837984e7e protoc: make sure output directory exists for java 2019-05-06 08:17:20 +02:00
ita1024 b2d6866096 Merge branch 'pyqt5-cmdline-1' into 'master'
pyqt5 extra enhancements

See merge request ita1024/waf!2229
2019-04-26 05:38:23 +00:00
fedepell 23b09f7493 pyqt5: bugfix, check the correct variable for RCC executable 2019-04-25 11:56:08 +02:00
fedepell d7f5b986c6 pyqt5: correct the spelling to PySide2 in all occourences 2019-04-25 11:55:31 +02:00
fedepell 6c1465a6ac pyqt5: add option to enable explicitly PyQt5 bindings
Previously one could explicitly state to use PySide2 or PyQt4 but not PyQt5 which was picked just by default. In this way the option can override local configurations and also this prevents to have mixed tools versions if we are sure we need PyQt5.
2019-04-25 11:53:00 +02:00
Thomas Nagy 2e58ac4134
When creating the waf script, assume that the 'extras' folder only contains Python files
Files are also listed in a static arbitrary order.
2019-04-23 07:39:19 +02:00
Thomas Nagy 4ed9af0ee9
Node.listdir outputs are already sorted, do not sort it again in Node.ant_glob 2019-04-23 07:13:02 +02:00
Thomas Nagy 8a32540045
Workaround for Issue 2232 2019-04-22 00:14:17 +02:00
Thomas Nagy 85c499b1cc
Describe how to load md5_tstamp - Issue 2231 2019-04-19 18:47:02 +02:00
ita1024 14ba605138 Merge branch 'doxy' into 'master'
doxygen: maintain order of lines in doxyfile

See merge request ita1024/waf!2223
2019-04-18 06:16:24 +00:00
ita1024 782ee0fcbc Merge branch 'msvcdeps-nostdout' into 'master'
msvcdeps: fix 'WafError' AttributeError

See merge request ita1024/waf!2226
2019-04-18 06:12:37 +00:00
ita1024 61c9415b30 Merge branch 'javadoc-optional' into 'master'
javaw: make javadoc optional

See merge request ita1024/waf!2225
2019-04-18 06:12:08 +00:00
ita1024 88a88fa671 Merge branch 'msvc-debug' into 'master'
msvc: add pdb_install_task with /DEBUG:* flags

See merge request ita1024/waf!2224
2019-04-18 06:11:07 +00:00
Robert Herbst fc7648b386 javaw: make javadoc optional
Make javadoc optional to support builds on platforms that don't include
javadoc in their Java distribution.
2019-04-16 19:09:43 -05:00
Kevin Markussen cce984f77b msvcdeps: fix 'WafError' AttributeError
This patch corrects an error in the exec_response_command exception
handler which always assumed that the execution's stdout would be bound
to the the WafError exception object.

However, this assumption is only true when the execution completes with
a non-zero status code. For other exceptions, the stdout attribute is
not bound.

Now, when stdout is not available, the WafError msg will be used
instead.
2019-04-16 17:28:28 -05:00
Lucian Teodorescu 08723978e2 doxygen: maintain order of lines in doxyfile
The order of the lines in a doxyfile are important. This patch uses an
ordered dictionary to keep the keys of the doxyfile in the same order.

This is particularly important for doxyfiles that contain @INCLUDE
lines. In such cases, if the dictionary is not ordered, the @INCLUDE
line can end up in the middle of the generated doxyfile and thus
override all entries that were seen before it.
2019-04-15 18:01:49 -05:00
James Harris c083461978 msvc: add pdb_install_task with /DEBUG:* flags
Currently PDBs are only installed if the /DEBUG flag appears in the
current toolchain's LINKFLAGS attribute. This patch expands support
so that /DEBUG:FULL and /DEBUG:FASTLINK also cause PDBs to be
installed.
2019-04-15 17:52:03 -05:00
Thomas Nagy 5e90de89d8
Python 2 encoding enhancements - Issue 2230 2019-04-15 21:18:45 +02:00
ita1024 9f2ce1b776 Merge branch 'fix-macos-syms' into 'master'
extras/syms: fix symbol regex on mac-o binaries

See merge request ita1024/waf!2222
2019-04-01 18:55:40 +00:00
William Light 944debb156 extras/syms: fix symbol regex on mac-o binaries
mac-o symbols are prefixed with an underscore. when specifying multiple
sub-regexes (e.g. 'sym1|sym2|sym3'), only the first will be matched
(since the expansion turns into '(?P<symbol>_?sym1|sym2|sym3)'). here,
this is remedied by wrapping the symbol regex in a paren group.
2019-03-31 19:32:39 +02:00
ita1024 e260b4a642 Merge branch 'color-msvc' into 'master'
Add color_msvc tool, which colorizes MSVC output

See merge request ita1024/waf!2221
2019-03-26 06:31:16 +00:00
Alibek Omarov 62b935aec8 Add color_msvc tool, which colorizes MSVC output like GCC does by default 2019-03-20 01:25:48 +00:00
ita1024 bffbcec678 Merge branch 'waf_ut_enc' into 'master'
waf_unit_test: prevent error when dumping run to script and environment contains UTF-8 chars

See merge request ita1024/waf!2220
2019-03-12 16:52:47 +00:00
fedepell f903ad5f90 waf_unit_test: prevent error when dumping run to script and environment contains UTF-8 chars 2019-03-12 15:46:46 +01:00
Thomas Nagy 02c9f814da
waf-2.0.15 2019-03-10 16:44:06 +01:00
Thomas Nagy 5f811ee018
waf-2.0.15 2019-03-10 16:22:03 +01:00
ita1024 503db290b7 Merge branch 'typos' into 'master'
Typos

See merge request ita1024/waf!2219
2019-03-08 06:41:22 +00:00
Matt Selsky d8f7fe165f Typos 2019-03-07 22:13:40 -05:00
Thomas Nagy b1baa2b8e1
Revert the args file threshold on non-win32 systems from #2214 2019-03-03 17:43:34 +01:00
Thomas Nagy b72fabf8e5
Do not expose Task.allow_argsfile and remove allow_argsfile from non-Task class #2216
The class waflib.Tools.winres.rc_parser is not a subclass of waflib.Task.Task:
rc_parser -> c_preproc.c_parser -> object
2019-03-03 17:04:53 +01:00
ita1024 e3c0c1b571 Merge branch 'add-allow_argsfile-to-tasks' into 'master'
task: winres: allow tasks to disable @argsfile

Closes #2224

See merge request ita1024/waf!2216
2019-03-03 15:15:36 +00:00
ita1024 7aa608889d Merge branch 'fix-path-calculations-in-git-bash' into 'master'
Utils: only use msys2 paths from msys2 python

See merge request ita1024/waf!2217
2019-02-26 17:26:32 +00:00
James Harris 84fd982f4b Utils: only use msys2 paths from msys2 python
This patch attempts to detects if, when we are running from within an
MSYS2 environement (MSYSTEM is set) we are also executing inside an
MSYS2 provided version of python. It does this by assuming that if we
are not in a cygwin environment and we are building on windows, If the
value of sys.executable is /usr/bin or /bin or /usr/local/bin (somethign
unixy) then we are running in an MSYS2 python interpreter and shoudl
compensate for msys2 root paths. Otherwise we shouldn't be doing extra
path manipulation.
2019-02-26 17:26:32 +00:00
Thomas Nagy 57377901fe
Fix 4046e48ac1 from #2214
TypeError: can only concatenate list
2019-02-24 10:50:44 +01:00
James Harris 9599cc532f task: winres: allow tasks to disable @argsfile
Not all tools executed by tasks support the '@argsfile' syntax for
shunting commandline arguments to a file. This means that if such
commands are shunted to a file early, he command will not work. On
windows the rc.exe command is such an example, but some tools on linux
have similar limitations. In the posix case, we artifically limit our
commandline size because it is difficult/variable to caluclate what the
actual limit is (it is partially dependent on environment size). This
could artifically cause commands to fail due to commandline length when
they otherwise wouldn't.

This patch fixes this issue by adding the 'allow_argsfile' flag to the
task. This way certain task instances will be able to specify if they
are compatible with the '@argsfile' syntax or not.
2019-02-19 12:48:04 -06:00
ita1024 2af495bcad Merge branch 'bug-2225-fix' into 'master'
Address ntpath bug with empty prefix

See merge request ita1024/waf!2215
2019-02-18 18:05:19 +00:00
James Harris 17b69226c4 Address ntpath bug with empty prefix
This patch addresses the bug described in issue #2225 where in using
posix paths and an empty PREFIX value can result in files being
installed to the root of the drive specified by destdir instead of to
the desired prefix value.  This is a bug in the assumption that user
specified paths that are strings will contain directory separators that
match the target operating system.
2019-02-18 11:38:45 -06:00
ita1024 bd3431e483 Merge branch 'fix-cmd-length-calculation' into 'master'
task: calculate correct cmdline bytes

See merge request ita1024/waf!2214
2019-02-15 17:33:27 +00:00
James Harris 4046e48ac1 task: calculate correct cmdline bytes
The previous patches to workaround
http://support.microsoft.com/kb/830473 drastically over estimated the
number of characters in commands by treating the repr() version of the
command array as a reasonable estimator of commandline length. This
caused commands attempt to write argsfiles before they should have.

The new calculation calculates the number characters in the command
array and adds the number of spaces that would be added by ' '.join(cmd)
this provides a much closer estimate of the commandline length.

This also limits the CLI-length on non windows platforms to 200kB. This
prevents us hitting the much larger argument limits on Linux/BSD/MacOS
platforms.
2019-02-15 10:50:27 -06:00
ita1024 f01354049d Merge branch 'patch-1' into 'master'
added stubs/ to lib search paths

See merge request ita1024/waf!2213
2019-02-14 06:45:43 +00:00
Maurizio Drocco cb28dc94ab added stubs/ to lib search paths 2019-02-13 23:40:47 +00:00
ita1024 62e5397d98 Merge branch 'java_antglob_warnings' into 'master'
javaw: add quiet=True to ant_globs to suppress warnings of globbing in build

See merge request ita1024/waf!2212
2019-01-31 19:34:22 +00:00
fedepell 44046343c9 javaw: add quiet=True to ant_globs to suppress warnings of globbing in build
Most of the ant_globs used are explicitly and knowingly on build directory
(ie. javadoc, jar re) so the warning is quite spurious. The only one that
may be in doubt is the source re one: I added also here because if you use
a code generator (ie. protoc) then it is also correct to glob on builds and
the warning is misleading.
2019-01-31 07:03:26 +01:00
ita1024 3050136230 Merge branch 'allow_multiple_default_cmds' into 'master'
Support multiple 'default_cmd'

See merge request ita1024/waf!2211
2019-01-30 06:53:25 +00:00
Adriano Scoditti 21ac17d510 Support multiple 'default_cmd' 2019-01-29 11:48:54 +01:00
ita1024 b59dcf5d80 Merge branch 'buildcopy-no-nodes' into 'master'
buildcopy: Added warning if buildcopy is used without any files to copy

See merge request ita1024/waf!2210
2019-01-25 18:43:23 +00:00
xbreak 33208b3747 buildcopy: Added warning if buildcopy is used without any files to copy 2019-01-25 12:25:28 +00:00
Thomas Nagy e641f171be
Use .pipelines/Jenkinsfile instead of demos/wscript 2019-01-22 08:08:55 +01:00
Thomas Nagy a827a73af6
Add a pipelines file 2019-01-21 07:30:19 +01:00
ita1024 389e2e4a4b Merge branch 'protoc_gen_java_poc' into 'master'
protoc: simplify the java generation also solving problems with .proto input files generated during build

See merge request ita1024/waf!2209
2019-01-20 10:41:51 +00:00
Federico Pellegrin 429c4c88d9 protoc: simplify the java generation also solving problems with .proto input files generated during build 2019-01-20 10:41:51 +00:00
Thomas Nagy 2f3d5e5163
Prevent protoc errors on "waf list" 2019-01-19 09:40:11 +01:00
Thomas Nagy 3bf0e7049b
Remove xrange in one example 2019-01-18 18:48:26 +01:00
ita1024 17e973a7d3 Merge branch 'protoc_java_fname_1' into 'master'
protoc: fix filename generation for .java

See merge request ita1024/waf!2208
2019-01-17 18:07:10 +00:00
fedepell f876a7b18c protoc: fix filename generation for .java 2019-01-17 14:45:40 +01:00
Thomas Nagy 68997828c8
Fix a few deprecation warnings 2019-01-16 06:51:14 +01:00
Thomas Nagy 1c75284614
docs 2019-01-05 16:20:45 +01:00
Thomas Nagy 4bd0c72809
Rework the previous changes 2019-01-05 16:16:48 +01:00
ita1024 ab24e0041e Merge branch 'fix-invalid-seq-warnings' into 'master'
Fix all DeprecationWarning: invalid escape sequence

See merge request ita1024/waf!2207
2019-01-05 15:07:58 +00:00
Mickaël Schoentgen 412a9b819e Fix all DeprecationWarning: invalid escape sequence
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-01-05 12:02:42 +01:00
ita1024 e68dc88857 Merge branch 'cython' into 'master'
Cython enhancements

See merge request ita1024/waf!2196
2018-12-29 10:11:19 +00:00
Thomas Nagy 353ffefa21
waf-2.0.14 2018-12-23 12:12:15 +01:00
Thomas Nagy 907519cab9
waf-2.0.14 2018-12-23 11:52:46 +01:00
ita1024 a77deaebdb Merge branch 'features/fc_submodules' into 'master'
Support for Fortran 2008 submodules.

See merge request ita1024/waf!2205
2018-12-22 00:14:42 +00:00
Harald Klimach 24ea24ff24 Added more syntactic cases to the demos/fortran/submodules example.
Also build a main program that uses the parent module.
2018-12-21 23:36:55 +01:00
Harald Klimach 9ff9eb73ad Added submodules demonstrator to demos/fortran.
Its only built if gfortran is used at least with version 6.
2018-12-21 23:14:19 +01:00
Harald Klimach e0254f7a75 Missing bracket in submodule appending of fc_scan. 2018-12-21 23:13:35 +01:00
Harald Klimach 3dbf2ee7f8 Support for the Fortran Compiler of the NEC SX-Aurora TSUBASA system. 2018-12-21 20:18:12 +01:00
Harald Klimach e77a6561a1 Support for Fortran 2008 submodules. 2018-12-21 19:53:12 +01:00
Thomas Nagy 3d1744151f
Possible solution for Msys path issues #2217 2018-12-21 11:47:51 +01:00
Thomas Nagy b1928ee46b
Let the protoc demo build even if java is missing 2018-12-21 11:10:57 +01:00
fedepell 70f1522fa1 protoc: handle extra taskgen and out of project include directories 2018-12-21 06:16:08 +01:00
ita1024 b755748c4c Merge branch 'features/gccdeps' into 'master'
Use correct variable in gccdeps config

See merge request ita1024/waf!2203
2018-12-19 17:56:00 +00:00
ita1024 fe873242bc Merge branch 'protoc-eh-1' into 'master'
protoc: fix included protoc search on nested wscripts

See merge request ita1024/waf!2202
2018-12-19 17:44:23 +00:00
Daniel Welty 4b905773ea Use correct variable in gccdeps config
The global value gccdeps was appended to CFLAGS and CXXFLAGS instead of
the actual flags tested against the compiler.  This ignored
modifications to the GCCDEPS_FLAGS environment variable and complicated
adding support for additional compilers at the project level.
2018-12-19 11:14:43 -06:00
fedepell ba1947b113 protoc: fix included protoc search on nested wscripts
previously code was erroneously using tg.bld.path instead of tg.path
so for nested wscript calls the wrong directory was used in search.

added also better error handling with error message if an included
directory does not exist
2018-12-19 15:45:48 +01:00
Thomas Nagy 82679503eb
docs 2018-12-19 11:30:45 +01:00
Thomas Nagy 4fd4de389c
Fix the api documentation build 2018-12-15 19:45:47 +01:00
ita1024 6417d5129d Merge branch 'javaw-docs' into 'master'
javaw: add some documentation on tool usage

See merge request ita1024/waf!2200
2018-12-14 06:40:49 +00:00
fedepell 9cd14427c1 javaw: add possibility to enable recurse use also globally via env variable 2018-12-14 05:50:27 +01:00
James Harris 69bac69b5a ccroot.py: add skip_stlib_deps feature 2018-12-13 22:30:54 +00:00
fedepell ce8d103cf4 javaw: add some documentation on tool usage 2018-12-13 16:00:17 +01:00
fedepell 37a36eabf2 javaw: add recursive use processing if recurse_use=True 2018-12-12 07:07:17 +01:00
Thomas Nagy ee719f1912 Improve the cuda example #2212 2018-12-07 07:57:43 +01:00
Thomas Nagy 1c7be35dc0
Fix broken cPython: md5.digest() is not supposed to raise exceptions #2213 2018-12-06 07:44:36 +01:00
Thomas Nagy 753b153631
Provide a better Cuda example #2212 2018-12-05 20:49:40 +01:00
Thomas Nagy bd15a9dce7
Try to load sha1 if md5 is unavailable
Also, the minimum version of Python required is 2.5, so hashlib is always present.
2018-12-05 20:35:19 +01:00
Thomas Nagy f70b5d062e
waf-2.0.13 2018-12-03 15:46:09 +01:00
Nicolas Pauss dede827db2 cython: add 'from cpython.version cimport PY_VERSION' example in playground.
This test the latest improvement of the regex in cython extra.
2018-12-03 09:51:47 +01:00
Romain Le Godais b367410172 playground/cython: Update cython cache files.
The cache was generated with an old cython version (0.15.1). Update it by
generating it with a more recent version (0.29).
2018-12-03 09:46:47 +01:00
Thomas Nagy 1607738e97
Fix the extra message "Broken revdeps" that may appear on certain build failures 2018-11-27 07:55:49 +01:00
Thomas Nagy 7d3c89e1b0
Print PriorityTasks contents 2018-11-27 07:42:34 +01:00
Romain Le Godais b3d974a0b9 cython: use a set for mods instead of a list.
There can be multiple imports of the same module in a single file, so
avoid evaluating them multiple times.
2018-11-24 12:59:35 +01:00
Thomas Nagy d7e701e4eb
Keep running configuration tests with parallel jobs
Passing "-j1" to "waf configure" already sets the maximum amount of jobs to 1,
so the change in a2105efc6f
is deemed unnecessary.
2018-11-21 22:01:20 +01:00
Romain Le Godais e1981e936f md5_tstamp: Fix documentation.
According to the code, file size is not taken into account to know is the
hash should be recomputed.
2018-11-21 15:02:58 +01:00
Thomas Nagy d02a15ae47
Always define the attribute "spawner" a2105efc6f 2018-11-18 11:52:34 +01:00
Romain Le Godais af74bbcbee cython: Enhance import regexp.
* avoid matching commented imports
* support `from foo.bar import baz` syntax.
2018-11-18 10:39:17 +01:00
Romain Le Godais 895191b5c4 Configure: Fix bug when build directory creation fails.
Seen thanks to pylint.
2018-11-18 09:32:39 +01:00
Stefan Metzmacher a2105efc6f Fixes for broken python threading on AIX 2018-11-18 01:03:16 +00:00
Romain Le Godais e74760c666 Fix description of `before` and `after` attributes of Task class.
Their descriptions were actually the opposite of what they really are.
2018-11-15 10:22:39 +01:00
Romain Le Godais b647ae76b2 Fix TaskGen idx attribution when 'path' argument is given.
When the 'path' argument was given at TaskGen creation, it was not taken
into account for attributing idx (the path of the build context was).

This is an issue when creating task generators from a waf tool because
their idxs were attributed as if they were in the project root directory,
even if another path was specified, which could lead to output files
collisions.
2018-11-11 14:32:22 +01:00
Adriano Scoditti 4611188e90 Restore original launch_dir on autoconfigure to correctly parse cli options 2018-11-06 18:16:18 +01:00
Thomas Nagy 314bd31e6a
Find more Swig dependencies - Issue 2206 2018-11-06 00:20:31 +01:00
Adriano Scoditti 9923a2e22e Removes hard-coded 'c4che' references using 'Build.CACHE_DIR' instead 2018-10-30 12:00:48 +01:00
Eric Müller 1efa74d38a Append python-config output only once 2018-10-23 12:38:41 +02:00
Thomas Nagy 88e9382f1b
waf-2.0.12 2018-10-07 20:05:42 +02:00
Thomas Nagy fc59ca785d
Limit sig_vars calls to super() to fix #2194 2018-10-03 21:28:42 +02:00
Adriano Scoditti 9f523216ea Update waf_unit_test command logging to be compatible with 'WAF_CMD_FORMAT' 2018-10-03 17:34:08 +02:00
Thomas Nagy fab68b4b8c
Remove the exception raised by tests/install/wscript 2018-09-27 19:25:36 +02:00
Thomas Nagy d63e32633d
Add tests for #2184 2018-09-25 18:05:10 +02:00
jadoro 72ba2cff1e Interpret relative install paths relative to PREFIX 2018-09-25 13:24:51 +02:00
Thomas Nagy fe03c6fa47
waf-2.0.11 2018-09-02 02:36:14 +02:00
Thomas Nagy a97f6fb094
Do not raise an exception on check_cfg/mandatory=False/-vv #2193 2018-08-28 23:37:48 +02:00
Thomas Nagy f09a1c56ca
Fix #2191 2018-08-24 22:41:05 +02:00
mmooij 02c20b8e85 Check if sources/include are Nonde3 type 2018-08-21 17:52:09 +02:00
Thomas Nagy 57fc628d2b
Disable warnings on versioned library installation 2018-08-16 23:30:59 +02:00
Thomas Nagy 922186f7a8 docs 2018-08-16 23:30:05 +02:00
Daniel Bartel ef90934434 spawn a subprocess for cpplint to avoid threading issue 2018-08-10 23:49:52 +02:00
Thomas Nagy 04e1b65ecb
waf-2.0.10 2018-07-29 13:24:16 +02:00
Thomas Nagy 31a5fa3829
Rework 3e06a0b9a2 2018-07-29 13:19:59 +02:00
Thomas Nagy 3f4acd6ff3
Add a new task semaphore system 2018-07-29 12:13:54 +02:00
Matt Selsky a10822f688 Fix typos 2018-07-28 19:47:10 -04:00
Thomas Nagy 3fc8c8c68a
Fix deadlocks affecting generated Fortran files #2187 2018-07-28 10:27:54 +02:00
Thomas Nagy 3e06a0b9a2
Fix --help when no wscript is supplied #2184 2018-07-27 11:17:06 +02:00
Thomas Nagy c543921e7d
waf-2.0.9 2018-07-09 16:43:40 +02:00
ita1024 8a950e7bca Merge branch 'add-python3-to-gitignore' into 'master'
Ignore temporary directories created when using Python 3

See merge request ita1024/waf!2179
2018-07-08 19:52:18 +00:00
Matt Selsky 8bd5adf041 Ignore temporary directories created when using Python 3 2018-07-08 14:58:47 -04:00
Matt Selsky 12b9f9aed1 Update GitHub URLs for GitLab equivalents 2018-07-08 14:53:13 -04:00
Thomas Nagy 1de8d03fb2
docs 2018-07-04 07:41:12 +02:00
Thomas Nagy 1f5e3e2d6c
Fix a regression caused by the previous change 2018-07-03 07:53:19 +02:00
Thomas Nagy 1787ec1f20
Add dependencies on scriptlet outputs 2018-07-02 19:15:09 +02:00
Jonathan Bendes 4b6ea4c7e8 Made options optional for cython waftool 2018-06-27 07:22:10 +02:00
fedepell 80aba755c1 doxygen: make error management if doxygen configuration file not found a bit more user friendly 2018-06-06 23:39:32 +02:00
fedepell 8b4d979dad doxygen: task_gen has no attribute generator, correct reference and make error message a bit more readable 2018-06-06 23:39:32 +02:00
Matt Selsky efea0378fd python docs: check_python_version also defines PYTHONARCHDIR 2018-05-24 18:02:03 +02:00
Thomas Nagy 656a30d364
waf-2.0.8 2018-05-22 23:07:04 +02:00
Thomas Nagy f78fbc32bb
Simplifications 2018-05-19 11:30:05 +02:00
Thomas Nagy 6873a1b4c6
Work around Python 3.6 console issues #2163 2018-05-19 11:23:46 +02:00
Mark Flanagan 5faa15a9f3 Don't quote or escape arg file lines for moc/rcc
Qt parses each argument line-by-line. Avoiding the quoting and escaping
from Task.quote_flag saves us from "too many files specified" moc/rcc error.
2018-05-17 00:00:49 +02:00
Federico Pellegrin 2a18ea239a eclipse: make all generated file utf-8 encoded (#2166)
Eclipse generates them by default in utf-8 (or will resave them
as such the moment they are touched) so this is more conformant
to eclipse format.
2018-05-11 16:13:06 +02:00
fedepell 974e4d0d0b eclipse: give a better name to waf variable indicating the waf executable path 2018-05-11 13:45:09 +02:00
Federico Pellegrin 48a4f6a765 eclipse: generate an external builder when no CDT is used in the project (#2164)
When CDT is not included in the project (ie. we just have Python and/or Java) the current implementation would not create automatically a call to waf
for the build stage. This patch adds in such cases an external builder that automates the call to waf without the need to manually configure one.
2018-05-11 12:16:04 +02:00
fedepell 30b883a32d eclipse: add generation of external jar dependencies for java projects to eclipse file 2018-05-09 22:37:58 +02:00
Thomas Nagy 55d975f25e
Fix the API docs 2018-05-09 07:23:37 +02:00
Thomas Nagy 8e40c98e0c
Docs: mention PYTHONIOENCODING for windows console users 2018-05-09 07:17:42 +02:00
Thomas Nagy 7bc3f787b2
Rework the vswhere.exe execution
- Do not shadow the encoding parameter for subprocess.Popen in Python 3.6
- Describe console settings
- Import ctypes only if available
2018-05-08 23:46:01 +02:00
Suzumizaki c2980e5090 Adhoc fix where waf cannot run under Japanese version of Windows. (#2155) 2018-05-08 22:55:19 +02:00
fedepell 64a582ecc2 eclipse: add support for generated files management for java and python
added support to search and add into source path also generated source
files for both java and python. this is useful when using generated code
(ie. protoc and pyqt5) so browsing in eclipse works correclty adding also
paths where generated code is done.

extended example in playground demostrating generated code
2018-04-22 00:40:28 +02:00
fedepell c4f8e20e69 pyqt5: improve the sample in playground so can easily work also with pyside2 2018-04-18 08:05:07 +02:00
fedepell 4682f543ce eclipse: handle case where python install_from is a Node object 2018-04-17 07:20:20 +02:00
fedepell 891f3e809d eclipse: correct feature name to javac not java
it was actually working anyway if the features were passed as a string (as in the playground example) but not if passed as a list
2018-04-16 18:45:43 +02:00
Thomas Nagy f8c86e0895
Provide the 'def:' string through a variable #2148 2018-04-14 08:39:27 +02:00
Thomas Nagy bef6f1b4bf
Cleanup #2146 2018-04-07 10:35:07 +02:00
Eric Newberry fab94287f8 detect arch-specific library path for Boost on dpkg-based systems 2018-04-07 10:34:09 +02:00
fedepell 6363147a5e java demos: correct jaropts parameter example to an array as it is then used as such in javaw.py 2018-04-04 20:29:37 +02:00
voodoo66 f03040c960 fixed typo in documentation for Configure.find_program 2018-04-02 20:27:53 +02:00
Thomas Nagy 8abce6ddd3
docs 2018-04-02 12:06:54 +02:00
Thomas Nagy 9cf12afa62
docs 2018-04-01 23:31:45 +02:00
287 changed files with 10912 additions and 4003 deletions

9
.gitignore vendored
View File

@ -8,6 +8,9 @@ build
demos/*/build*
playground/*/build*
.waf-*
waf-*
.waf3-*
waf3-*
*.log
.DS_Store
.AppleDouble
@ -36,3 +39,9 @@ Temporary Items
# Windows build output
waf.bat
# Vim temporary files
*.swp
# YouCompleteMe configuration
.ycm_extra_conf.py

292
.pipelines/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,292 @@
pipeline {
agent none
stages {
stage('Build and Lint') {
parallel {
stage('Python 2.7') {
agent {
label "ubuntu"
}
steps {
sh 'python3 ./waf-light'
sh 'python2.7 ./waf --help'
stash includes: 'waf', name: 'waf'
}
}
stage('Python 3.6') {
agent {
label "freebsd"
}
steps {
sh 'python3.6 ./waf-light'
}
}
stage('Deprecation warnings') {
agent {
label "ubuntu"
}
steps {
sh '''
cd waflib
find . -iname "*.pyc" -exec rm -f {} \\; || true
! (((PYTHONWARNINGS=all python3.6 -m compileall . > /dev/null) 2>&1 ) 2>&1) | grep -i DeprecationWarning
'''
}
}
stage('Pyflakes') {
agent {
label "freebsd"
}
steps {
sh '''
cd waflib
var=`(/usr/local/bin/pyflakes3.py *.py Tools/*.py extras/*.py 2>&1) | egrep "undefined name|invalid syntax|inconsistent use|unindent does not match any outer indentation level" | wc -l`
if [ "0" -eq "$var" ]
then
/usr/local/bin/pyflakes3.py *.py Tools/*.py extras/*.py || true
else
# just do it again and fail
/usr/local/bin/pyflakes3.py *.py Tools/*.py extras/*.py
exit 1
fi
'''
}
}
stage('Unit tests') {
agent {
label "fedora"
}
steps {
sh '''
./waf-light
cd tests/preproc/
../../waf distclean
../../waf configure build
cd ../..'''
sh '''
cd tests/install/
../../waf distclean
../../waf configure build
cd ../..'''
sh '''
cd tests/general/
../../waf distclean
../../waf configure build
cd ../..'''
sh '''
export PATH=$PATH:$PWD
cd tests/init/
../../waf distclean
../../waf configure build
cd ../..'''
sh '''
export WAF_TEST_GROUP=waftest
cd tests/install_group/
../../waf distclean
../../waf configure build
'''
}
}
}
}
stage('Integration') {
parallel {
stage('Ubuntu') {
stages {
stage('py25') {
agent {
label "ubuntu"
}
steps {
dir('demos') {
unstash 'waf'
}
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=c'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=c++'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=java'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=perl'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=python'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=qt5'''
sh '''cd demos; LD_LIBRARY_PATH=/opt/lib ./waf distclean configure clean build --top=subst'''
}
}
stage('py36') {
agent {
label "ubuntu"
}
steps {
dir('demos') {
unstash 'waf'
}
sh '''cd demos; python3 ./waf configure clean build --top=c'''
sh '''cd demos; python3 ./waf configure clean build --top=c++'''
sh '''cd demos; python3 ./waf configure clean build --top=java'''
sh '''cd demos; python3 ./waf configure clean build --top=perl'''
sh '''cd demos; python3 ./waf configure clean build --top=python'''
sh '''cd demos; python3 ./waf configure clean build --top=qt5'''
sh '''cd demos; python3 ./waf configure clean build --top=subst'''
}
}
stage('py27') {
agent {
label "ubuntu"
}
steps {
dir('demos') {
unstash 'waf'
}
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=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=qt5'''
sh '''cd demos; ./waf configure clean build --top=subst'''
}
}
}
}
stage('OpenBSD') {
stages {
stage('Jython') {
agent {
label "openbsd"
}
steps {
sh '''
export WAF_NO_PREFORK=1
python3 ./waf-light
cp waf demos/c
cd demos/c
/home/jenkins/jython/bin/jython ./waf distclean configure clean build
'''
}
}
stage('py38') {
agent {
label "openbsd"
}
steps {
dir('demos') {
unstash 'waf'
}
sh '''cd demos/asm; python3 ../waf configure clean build'''
sh '''cd demos/c; python3 ../waf configure clean build'''
sh '''cd demos/c++; python3 ../waf configure clean build'''
sh '''cd demos/glib2; python3 ../waf configure clean build'''
sh '''cd demos/perl; python3 ../waf configure clean build'''
sh '''cd demos/python; python3 ../waf configure clean build'''
sh '''cd demos/subst; python3 ../waf configure clean build'''
}
}
}
}
stage('Windows') {
stages {
stage('C/py34') {
agent {
label "windows"
}
steps {
bat ''' C:/Python34/python.exe waf-light --tools=msvs '''
bat '''
copy waf demos\\c /Y
cd demos\\c
C:/Python34/python.exe waf distclean
C:/Python34/python.exe waf configure --no-msvc-lazy build -v
'''
bat '''
copy waf demos\\qt5 /Y
cd demos\\qt5
C:/Python34/python.exe waf distclean
C:/Python34/python.exe waf configure --no-msvc-lazy build -v
'''
bat '''
copy waf playground\\msvs /Y
cd playground\\msvs
C:/Python34/python.exe waf distclean
C:/Python34/python.exe waf configure
C:/Python34/python.exe waf msvs
'''
}
}
stage('C/Msys2/py27') {
agent {
label "windows"
}
steps {
unstash 'waf'
bat '''
copy waf demos\\c /Y
cd demos\\c
set MSYSTEM=MINGW64
set WD=C:\\msys64\\usr\\bin
set CHERE_INVOKING=1
C:\\msys64\\usr\\bin\\sh --login -c 'exec /bin/bash -c "python waf configure clean build && python waf distclean"'
'''
}
}
stage('C/Msys2/py35') {
agent {
label "windows"
}
steps {
unstash 'waf'
bat '''
copy waf demos\\c /Y
cd demos\\c
set MSYSTEM=MINGW64
set WD=C:\\msys64\\usr\\bin
set CHERE_INVOKING=1
C:\\msys64\\usr\\bin\\sh --login -c 'exec /bin/bash -c "python3 waf configure clean build && python3 waf distclean"'
'''
}
}
}
}
stage('FreeBSD') {
stages {
stage('py36') {
agent {
label "freebsd"
}
steps {
dir('demos') {
unstash 'waf'
}
sh '''cd demos/c; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/c++; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/java; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/jni; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/perl; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/python; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/ruby; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/glib2; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/qt5; python3.6 ../waf distclean configure clean build'''
sh '''cd demos/dbus; python3.6 ../waf distclean configure clean build'''
}
}
}
}
stage('MacOS') {
stages {
stage('py27') {
agent {
label "macos"
}
steps {
dir('demos') {
unstash 'waf'
}
sh '''cd demos/c; ../waf distclean configure clean build'''
sh '''cd demos/python; ../waf distclean configure clean build'''
sh '''cd demos/mac_app; ../waf distclean configure clean build'''
}
}
}
}
}
}
}
}

View File

@ -1,66 +1,18 @@
NEW IN WAF 2.0.7
----------------
* Apply priorities to dynamically-generated tasks #2137
* Fix upcoming Python 3.7 incompatibilities #2126
* Fix Python3 support in extras/xcode6.py #2121
* Improve priority support in extras/swig.py #2137
* Improve support extras/protoc.py #2135
* Improve argument handling in extras/clang_compilation_database.py #2127
* Add glib DBus bindings in extras/gdbus.py #2134
* Avoid name collisions for precompiled headers and libraries with similar names in extras/pch.py #2122
CHANGES IN WAF 2.1.0
--------------------
* While the Waf file runs on Python 2 and 3, creating it requires Python 3
+ Added wafcache
+ waf_unit_test: Added task in returned tuples, custom reports should be adapted
~ Ensure ConfigurationContext.load and Context.load definitions are consistent and remove unused *k parameters
~ Remove the dependency on optparse and use argparse instead
- Remove waflib.Runner.PriorityTasks.appendleft
- Remove waflib.Task.TaskBase
- 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
----------------
* 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
----------------
CHANGES IN WAF 2.0.0
--------------------
* Provide a new priority system 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)
@ -71,12 +23,12 @@ NEW IN WAF 2.0.0
* Accept nested lists and generators in bld(source=...)
* Sort TaskGen methods in alphabetical order by reversing TaskGen.prec order
* Remove 'ut_fun' from waf_unit_test.py
* Remove Node.sig and Node.cache_sig
* Remove the BuildContext.rule decorator
* Remove Task.update_outputs, Task.always_run
* Remove atleast-version, exact-version and max-version from conf.check_cfg
* Remove c_preproc.trimquotes
* Remove field_name, type_name, function_name from conf.check() tests
* Remove extras/mem_reducer.py as a better solution has been merged
* Remove Utils.ex_stack (use traceback.format_exc())
- Remove 'ut_fun' from waf_unit_test.py
- Remove Node.sig and Node.cache_sig
- Remove the BuildContext.rule decorator
- Remove Task.update_outputs, Task.always_run
- Remove atleast-version, exact-version and max-version from conf.check_cfg
- Remove c_preproc.trimquotes
- Remove field_name, type_name, function_name from conf.check() tests
- Remove extras/mem_reducer.py as a better solution has been merged
- Remove Utils.ex_stack (use traceback.format_exc())

5
DEVEL
View File

@ -1,4 +1,4 @@
Waf 2.0 is on https://github.com/waf-project/waf
Waf 2.0 is on https://gitlab.com/ita1024/waf
------------------------------------------------
waflib the core library
@ -30,7 +30,7 @@ General coding guidelines
Pull requests
-------------
See https://github.com/waf-project/waf
See https://gitlab.com/ita1024/waf
When implementing complex features, please add examples in the showcase folder demos/
for modules under waflib/Tools, under tests/ for platform-independent unit tests,
@ -38,4 +38,3 @@ or in playground/ for modules under waflib/extras.
The files under waflib/Tools/ are kept API-compatible for the duration
of a middle version (currently 2.0).

25
LICENSE Normal file
View File

@ -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.

View File

@ -1,51 +1,50 @@
## 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:
* *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
* *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
* *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/)
* *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.4, Jython 2.5, IronPython, and Pypy
* *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
* *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
* *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/`)
* *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
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://github.com/waf-project/waf/tree/master/build_system_kit) and [package distribution systems](https://github.com/waf-project/waf/tree/master/playground/distnet/README.rst).
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://github.com/waf-project/waf/tree/master/demos) and [experiments](https://github.com/waf-project/waf/tree/master/playground).
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).
## 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:
Python >= 2.7 is required to generate the waf script:
```sh
$ ./waf-light configure build
```
Or, if several python versions are installed:
```sh
$ python3 ./waf-light configure build
python ./waf-light configure build
```
## CUSTOMIZATION
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
if the module does not exist under the 'extras' folder:
```sh
$ ./waf-light --tools=swig
./waf-light --tools=swig
```
To customize the initialization, pass the parameter 'prelude'. Here is for example
how to create a waf file using the compat15 module:
```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
may be easier (folder build\_system\_kit):
```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".
@ -53,9 +52,9 @@ To avoid regenerating the waf file all the time, just set the `WAFDIR` environme
## HOW TO RUN THE EXAMPLES
Try this:
```sh
cp waf demos/c/
cd demos/c/
./waf configure build
```

8
TODO
View File

@ -1,8 +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()

View File

@ -27,7 +27,7 @@ class Context(mod.Context):
cache[node] = True
self.pre_recurse(node)
try:
function_code = node.read('rU')
function_code = node.read('r')
exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict)
finally:
self.post_recurse(node)

View File

@ -1,23 +1,22 @@
#include "header.h"
.text
.align 2
.section .data
.data
val:
.long SOME_VALUE
.text
.align 2
// Multiply input value by 421...
.global mult10
.type mult10, function
.type mult10, @function
mult10:
pushq %rbp
movq %rsp,%rbp
movl val,%eax
movabs val,%eax
imull %edi,%eax
popq %rbp
ret

View File

@ -18,10 +18,11 @@ def build(bld):
source = 'main.c test.S',
target = 'asmtest',
defines = 'foo=12',
includes = '.')
asflags = '-Os',
includes = '.',
linkflags = '-no-pie')
def disp(ctx):
node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0]
ctx.exec_command('%s' % node.abspath(), shell=False)
bld.add_post_fun(disp)

View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include "external_vars.h"
int k = 5;
void print_value_of_k() {
printf("K = %d\n", k);
}

View File

@ -0,0 +1,14 @@
/*
Export internal vars
*/
#ifndef _EXTERNAL_VARS_H
#define _EXTERNAL_VARS_H
extern int k; /* export k */
void print_value_of_k();
extern int r;
#endif /*_EXTERNAL_VARS_H */

View File

@ -0,0 +1,7 @@
# This is a static library that provides a header to include reference to
# internal variables.
bld.stlib(
target='A',
source='external_vars.c',
includes='.',
export_includes='.')

View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include "sum.h"
#include "external_vars.h"
void sum(int j) {
printf("Adding %d...\n", j);
// Add our new value
k += j;
}

View File

@ -0,0 +1,10 @@
/*
Export internal vars
*/
#ifndef _SUM_H
#define _SUM_H
void sum(int j);
#endif /*_SUM_H */

View File

@ -0,0 +1,9 @@
# This script uses libA to do some internal logic. It uses the default
# behavior so it will be re-archived every time libA changes, even if
# changes in libA are only visible at runtime.
bld.stlib(
target='B',
source='sum.c',
use='A',
includes='.',
export_includes='.')

View File

@ -0,0 +1,13 @@
#include <stdio.h>
#include "diff.h"
#include "external_vars.h"
void diff(int j) {
printf("Subtracting %d...\n", j);
// subtract our new value
k -= j;
}

View File

@ -0,0 +1,10 @@
/*
Export internal vars
*/
#ifndef _DIFF_H
#define _DIFF_H
void diff(int j);
#endif /* _DIFF_H */

View File

@ -0,0 +1,10 @@
# This script uses the logic that prevents static libraries from depending on
# eachother. This means that the only way libC is re-archived is if the source
# code file diff.c or any of its depenencies change.
bld.stlib(
target='C',
source='diff.c',
features='skip_stlib_link_deps',
use='A',
includes='.',
export_includes='.')

22
demos/c/stlib-deps/main.c Normal file
View File

@ -0,0 +1,22 @@
#include <stdio.h>
#include "external_vars.h"
#include "sum.h"
#include "diff.h"
int main()
{
/* This should return to whatever the default value is. */
print_value_of_k();
sum(6);
print_value_of_k();
diff(8);
print_value_of_k();
sum(8);
print_value_of_k();
diff(6);
print_value_of_k();
return 0;
}

View File

@ -0,0 +1,11 @@
#! /usr/bin/env python
bld.recurse('libA')
bld.recurse('libB')
bld.recurse('libC')
# Note that main has an implied dependency between our main program and libA
bld.program(
source = 'main.c',
target = 'test_static_link_chain',
use = 'B C')

View File

@ -27,12 +27,15 @@ def configure(conf):
conf.check(fragment='int main() { return 0; }\n', features='c')
try:
conf.check(fragment="int main() { return 0; }\n", execute=True) # 1
conf.check(fragment="int main(int argc, char* argv[]) { return 0; }\n", execute=True) # 1
except conf.errors.WafError:
Logs.warn('You are probably using a cross-compiler (disabling specific configuration tests)')
conf.check_library(test_exec=False)
else:
conf.check(fragment="""#include<stdio.h>\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU')
conf.check(fragment="""#include<stdio.h>\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""",
msg='Checking for exec results', execute=True, define_name='HAVE_MU')
conf.check(fragment='int main(int argc, char* argv[]) { return argc - 2;}',
msg='Checking for test arguments', test_args=['--foo=bar'], execute=True)
conf.check_library(test_exec=True)
conf.check(lib='m', cflags='-Wall', defines=['var=foo', 'x=y'], uselib_store='M', mandatory=False)
@ -75,7 +78,7 @@ def configure(conf):
def build(bld):
bld.env.DEFINES=['WAF=1']
bld.recurse('program stlib shlib')
bld.recurse('program stlib stlib-deps shlib')
#bld.install_files('/tmp/foo', 'wscript')
#bld.env.PREFIX='/tmp/foo'
bld.install_files('${PREFIX}/', 'program/a.h program/main.c', relative_trick=False)

View File

@ -0,0 +1,27 @@
submodule (parent) container
implicit none
contains
module procedure init
p%mother = mother
p%father = father
end procedure init
module subroutine harmonize(p)
type(parent_type), intent(inout) :: p
real :: avg
avg = 0.5 * (p%father + p%mother)
p%father = avg
p%mother = avg
end subroutine harmonize
module function parent_weight(p) result(w)
type(parent_type), intent(in) :: p
real :: w
w = p%mother**2 + p%father**2
end function parent_weight
end submodule container

View File

@ -0,0 +1,13 @@
submodule (parent:container) helper
implicit none
contains
module function parent_distance(pa, pb) result(dist)
type(parent_type), intent(in) :: pa, pb
real :: dist
dist = sqrt(parent_weight(pa) + parent_weight(pb))
end function parent_distance
end submodule helper

View File

@ -0,0 +1,30 @@
module parent
implicit none
type parent_type
real :: mother
real :: father
end type parent_type
interface
module subroutine init(p, mother, father)
type(parent_type), intent(out) :: p
real, intent(in) :: mother, father
end subroutine init
module subroutine harmonize(p)
type(parent_type), intent(inout) :: p
end subroutine harmonize
module function parent_weight(p) result(w)
type(parent_type), intent(in) :: p
real :: w
end function parent_weight
module function parent_distance(pa, pb) result(dist)
type(parent_type), intent(in) :: pa, pb
real :: dist
end function parent_distance
end interface
end module parent

View File

@ -0,0 +1,18 @@
program submain
use parent
implicit none
type(parent_type) :: a,b
real :: dist, weight
call init(a, 1.0, 2.0)
call init(b, 10.0, 12.0)
call harmonize(a)
weight = parent_weight(b)
write(*,*) weight
dist = parent_distance(a, b)
write(*,*) dist
end program submain

View File

@ -0,0 +1,26 @@
#! /usr/bin/env python
top = '.'
out = 'build'
def options(opt):
opt.load('compiler_c')
opt.load('compiler_fc')
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_fc')
def build(bld):
bld(
features = 'fc fcshlib',
source = 'parent.f90 container.f90 helper.f90',
target = 'fudge',
)
bld(
features = 'fc fcprogram',
source = 'submain.f90',
use = 'fudge',
target = 'submain',
)

View File

@ -78,3 +78,5 @@ def build(bld):
target = 'mod/two_mods')
bld.recurse('typemap')
if bld.env.FC_NAME == 'GFORTRAN' and int(bld.env.FC_VERSION[0]) >= 6:
bld.recurse('submodules')

View File

@ -0,0 +1,14 @@
package org.example;
//import org.example.Animal;
import org.example.Cat;
class Bengala extends Cat {
public String sound() {
return "Bengala Meow!";
}
}

View File

@ -0,0 +1,12 @@
#! /usr/bin/env python
def build(bld):
bld(features = 'javac',
srcdir = 'src',
compat = '1.7',
use = 'cats-src',
name = 'bengala-cat',
recurse_use = True,
)

View File

@ -6,9 +6,10 @@ import org.example.Animal;
class Cat extends Animal {
public String sound() {
// Use base class just to be able to trigger possible rebuilds based on base class change
String base = super.sound();
return "Meow!";
}
}

View File

@ -39,7 +39,7 @@ def build(bld):
compat = '1.6', # java compatibility version number
sourcepath = ['src', 'sup'],
classpath = ['.', '..'],
#jaropts = '-C default/src/ .', # can be used to give files
#jaropts = ['-C', 'default/src/', '.'], # can be used to give files
basedir = 'src', # folder containing the classes and other files to package (must match outdir)
destfile = 'foo.jar', # do not put the destfile in the folder of the java classes!
use = 'NNN',
@ -49,5 +49,5 @@ def build(bld):
javadoc_output = 'javadoc',
)
bld.recurse('animals cats')
bld.recurse('animals cats bengala')

View File

@ -1,6 +1,7 @@
// waf sample Mac application - main.m
// Chris Pickel, 2011
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
int main(int argc, const char* argv[]) {

View File

@ -21,7 +21,7 @@ def configure(conf):
if not conf.env.ARCH_ST:
conf.fatal('This example is for macs only')
conf.env.FRAMEWORK_COCOA = 'Cocoa'
conf.env.ARCH_COCOA = ['i386', 'x86_64']
conf.env.ARCH_COCOA = ['x86_64', 'arm64']
def build(bld):
bld.program(

View File

@ -0,0 +1,3 @@
"""
Nested file in bar/
"""

View File

@ -0,0 +1,3 @@
"""
Nested file in foo/
"""

View File

@ -50,3 +50,19 @@ def build(bld):
source = 'test.c',
target = 'test')
# Install files keeping their directory structure (default: relative_trick=True)
#
# This will create:
# * lib/python2.7/site-packages/nested_scripts/foo/nested_foo.py
bld(features='py',
source=bld.path.ant_glob('nested_scripts/foo/*.py'),
install_from='.')
# Install files flatting the directory structure (relative_trick=False)
#
# This will create:
# * lib/python2.7/site-packages/nested_bar.py
bld(features='py',
source=bld.path.ant_glob('nested_scripts/bar/*.py'),
relative_trick=False,
install_from='.')

View File

@ -3,7 +3,24 @@
#include "foo.h"
Foo::Foo() : QWidget(NULL) {
m_button = new QPushButton("Foo Button", this);
m_button->setGeometry(QRect(QPoint(50, 60),
QSize(120, 50)));
connect(m_button, SIGNAL (released()), this, SLOT (handleButton()));
myToggle = true;
}
void Foo::handleButton() {
if (myToggle) {
m_button->setText("Button Foo");
} else {
m_button->setText("Foo Button");
}
myToggle = !myToggle;
}
int Foo::FortyTwo() {
return 42;
}
class Bar_private : public QWidget {

View File

@ -4,13 +4,20 @@
#define _FOO
#include <QWidget>
#include <QPushButton>
class Foo : public QWidget {
Q_OBJECT
signals:
void test();
private slots:
void handleButton();
public:
Foo();
int FortyTwo();
QPushButton *m_button;
public:
bool myToggle;
};
#endif

View File

@ -4,12 +4,13 @@
//#include <QString>
//#include "mainwindow.h"
#include "ui_but.h"
#include "foo.h"
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(res);
QApplication app(argc, argv);
QWidget window;
Foo window;
Ui::Form ui;
ui.setupUi(&window);
window.show();

31
demos/qt5/testqt5.cpp Normal file
View File

@ -0,0 +1,31 @@
// Example of Qt5 Unit test with QtTest library
// Federico Pellegrin, 2019 (fedepell)
#include "foo.h"
#include <QtTest/QtTest>
class TestQt5Test: public QObject {
Q_OBJECT
private:
Foo myFoo;
private slots:
void testGui();
void testFunc();
};
// Test of the UI by simulating a button click and button label reading
void TestQt5Test::testGui() {
QCOMPARE(myFoo.m_button->text(), QString("Foo Button"));
QTest::mouseClick(myFoo.m_button, Qt::LeftButton,Qt::NoModifier, QPoint(5,5), 0);
QCOMPARE(myFoo.m_button->text(), QString("Button Foo"));
}
// Test of a normal function
void TestQt5Test::testFunc() {
QCOMPARE(myFoo.FortyTwo(), 44); // this fails! 42 != 44
}
QTEST_MAIN(TestQt5Test)
#include "testqt5.moc"

View File

@ -1,6 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2016 (ita)
# Federico Pellegrin, 2019 (fedepell)
VERSION='0.0.1'
APPNAME='qt5_test'
@ -9,12 +10,41 @@ top = '.'
out = 'build'
def options(opt):
opt.load('compiler_cxx qt5')
opt.load('compiler_cxx qt5 waf_unit_test')
def configure(conf):
conf.load('compiler_cxx qt5')
conf.load('compiler_cxx qt5 waf_unit_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
conf.check(
define_name = 'XYZ_QT5_TESTS',
mandatory = False,
execute = True,
features = 'qt5 cxx cxxprogram',
includes = '.',
defines = 'QT_WIDGETS_LIB',
use = 'QT5CORE QT5GUI QT5WIDGETS QT5TEST',
msg = 'Checking whether Qt5 tests can run',
fragment = '''
#include <QtTest/QtTest>
class TestQt5Test: public QObject {
Q_OBJECT
private:
void testGui() {
QWidget *widget = NULL;
QTest::mouseClick(widget, Qt::LeftButton, Qt::NoModifier, QPoint(5,5), 0);
}
};
QTEST_MAIN(TestQt5Test)
#include "test.moc"
''')
def build(bld):
# According to the Qt5 documentation:
# Qt classes in foo.h -> declare foo.h as a header to be processed by moc
@ -32,3 +62,27 @@ def build(bld):
langname = 'somefile', # include the .qm files from somefile.qrc
)
if bld.env.XYZ_QT5_TESTS:
# Example of integration of Qt5 Unit tests using Qt5Test using waf_unit_test
bld(
features = 'qt5 cxx cxxprogram test',
use = 'QT5CORE QT5GUI QT5WIDGETS QT5TEST',
defines = 'QT_WIDGETS_LIB',
source = 'foo.cpp testqt5.cpp',
moc = 'foo.h',
target = 'footest',
includes = '.',
# ut_str = './${SRC} -o test-report.xml,xunitxml', # put output to a xunit xml
)
bld.add_post_fun(print_test_results) # print output of test runner to user
def print_test_results(bld):
lst = getattr(bld, 'utest_results', [])
if not lst:
return
for result in lst:
print(result.out.decode('utf-8'))
print(result.err.decode('utf-8'))

View File

@ -10,7 +10,8 @@
\maketitle
\tableofcontents
\glossarystyle{altlist}
% next line is broken after using a newer texlive version
%\glossarystyle{altlist}
%% The glossary entries
\newglossaryentry{african}

View File

@ -17,7 +17,7 @@ def build(bld):
# optional parameters
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
# or more simply, for a pdf..

View File

@ -7,6 +7,7 @@ bld(
source = 'HelloWorldTest.cpp',
target = 'unit_test_program',
use = 'unittestmain useless CPPUNIT',
ut_str = '${SRC[0].abspath()} -flag1 ${NARG}'
ut_str = '${SRC[0].abspath()} -flag1 ${NARG}',
name = 'test0',
)

View File

@ -7,5 +7,6 @@ bld(
target = 'unit_test_program',
use = 'unittestmain useless CPPUNIT',
ut_cwd = bld.path,
name = 'test1',
)

View File

@ -5,7 +5,8 @@ if bld.env['PYTHON']:
bld(
features = 'test_scripts',
test_scripts_source = 'test.py',
test_scripts_template = '${PYTHON} ${SCRIPT}'
test_scripts_template = '${PYTHON} ${SCRIPT}',
name = 'test2',
)

View File

@ -23,7 +23,8 @@ if bld.env['PYTHON']:
features = 'test_scripts',
test_scripts_source = 'test.1.py test.2.py',
test_scripts_template = '${PYTHON} ${SCRIPT}',
test_scripts_paths = paths
test_scripts_paths = paths,
name = 'test3',
)

View File

@ -40,12 +40,16 @@ def summary(bld):
Logs.pprint('CYAN', 'test report %3.0f%% success' % val)
Logs.pprint('CYAN', ' tests that fail %d/%d' % (tfail, total))
for (f, code, out, err) in lst:
if code:
Logs.pprint('CYAN', ' %s' % f)
Logs.pprint('RED', 'status: %r' % code)
if out: Logs.pprint('RED', 'out: %r' % out)
if err: Logs.pprint('RED', 'err: %r' % err)
for result in lst:
if result.exit_code:
# In ut_task we have the task running the test and we can get any extra information
# from there (in this example just the generator name)
Logs.pprint('CYAN', ' %s (%s)' % (result.test_path, result.generator.name))
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):
bld.recurse('src tests')
@ -57,7 +61,7 @@ def build(bld):
# to execute all tests:
# $ waf --alltests
# to set this behaviour permanenly:
# to set this behaviour permanently:
#bld.options.all_tests = True
bld.options.clear_failed_tests = True

View File

@ -1,149 +0,0 @@
#! /usr/bin/env python
# encoding: utf-8
# J. Carretero, 2010 (zougloub)
# Thomas Nagy, 2010 (ita)
"""
https://launchpad.net/subunit/
"""
import sys, os
if "uname" in dir(os): machine = os.uname()[1]
elif sys.platform == "win32": machine = os.environ["COMPUTERNAME"]
else: raise Exception("Unknown platform, cannot get machine name")
from waflib import Logs, Errors
# python 2.3 tends to hang for whatever reason :-/
PYTHONS = "2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4 3.5".split()
DIRS = ['c', 'python']
if os.environ.get('BUILDFARM'):
DIRS = [x for x in os.listdir('.') if os.path.isdir(x) and x not in ('variants', 'build', 'mac_app', 'precious') and x.find('waf-') < 0]
def options(opt):
for d in opt.path.ant_glob(DIRS, excl=['build', 'variants'], src=False, dir=True):
if d.name[0] == '.' or d.name == 'variants' or d.name == 'build':
continue
try:
opt.recurse(d.name)
except Exception:
pass
# one sub-project uses autoconfig, but i do not want it here
from waflib import Configure
Configure.autoconfig = False
def configure(conf):
#Logs.info('Running action configure') # build farm
try:
sub = conf.find_file('subprocess.py', ['/usr/lib64/python', '/usr/lib/python', '/usr/local/lib64/python', '/usr/local/lib/python'])
except:
sub = ''
curwaf = os.path.abspath(sys.argv[0])
conf.exec_command('%s %s configure build --zip-type=gz --tools=doxygen,fluid,ocaml,swig,compiler_fc,fc_config,fc,fc_scan,g95,ifort,gfortran,batched_cc,%s --prelude='' && /bin/cp waf demos/' % (sys.executable, curwaf, sub),
cwd=conf.path.parent.abspath())
node = conf.path.find_resource('waf')
if not node:
conf.fatal('Could not find Waf')
#if conf.exec_command([node.abspath(), '--help'], shell=False, env={}, cwd=node.parent.abspath()):
# conf.fatal('the waf file cannot be executed')
conf.env.WAF = node.abspath()
conf.in_msg += 1
for d in conf.path.ant_glob(DIRS, excl=['build', 'variants', 'precious'], src=False, dir=True):
if d.name[0] == '.':
continue
conf.env.stash()
try:
conf.recurse(d.name)
except Exception:
conf.env.revert()
node = conf.path.find_node('%s/build/config.log' % d.name)
if node:
Logs.info('-- BEGIN %s config.log --\n%s-- END %s config.log --', d.name, node.read(), d.name)
try:
e = sys.exc_info()[1]
print(e)
print(e.stdout, e.stderr)
except Exception:
pass
else:
conf.env.revert()
conf.env.append_value('CFG', [d.name])
print("The configurations enabled are %r" % conf.env.CFG)
# now remove the cache folders and re-create them
#conf.cmd_and_log('rm -rf .waf*')
for x in PYTHONS:
try:
conf.find_program('python'+x, var=x)
# unpacking the waf directory concurrently can lead to a race condition, we'll need to take care of this (thanks, build farm!)
conf.cmd_and_log(conf.env[x] + ['./waf', '--version'], env={})
except Errors.WafError as e:
pass
else:
conf.env.append_value('PYTHONS', x)
Logs.info('executing the build for folders %r and with pythons %r', conf.env.CFG, conf.env.PYTHONS)
Logs.info("contents of config.log:")
Logs.info(conf.path.find_node('build/config.log').read())
def build(bld):
print('Note: call "waf installcheck" (the default build does not do anything)')
from waflib.Build import BuildContext
class abc(BuildContext):
cmd = "installcheck"
fun = "installcheck"
def installcheck(bld):
bld.jobs = 1
#if bld.cmd == 'build':
# Logs.info('Running action build') # build farm
#print('testsuite: waflib')
def waf_cmd(self):
cmd = self.env[self.generator.python] + [self.env.WAF, 'distclean', 'configure', 'build', 'clean', 'build', '-o', 'build' + self.generator.python]
cwd = self.generator.cwd
env = dict(os.environ)
env['WAFDIR'] = ''
env['WAFLOCK'] = '.lock-wscript' + self.generator.python # use a different build directory for each build
try:
bld.cmd_and_log(cmd, cwd=cwd, env=env, quiet=0, )
except Errors.WafError as e:
e = sys.exc_info()[1]
s = "testsuite: %s\ntestsuite-xfail: %s [ %s \n %s ]\n" % (self.generator.name, self.generator.name, e.stderr, e.stdout)
Logs.info(s)
else:
s = "testsuite: %s\ntestsuite-success: %s\n" % (self.generator.name, self.generator.name)
Logs.info(s)
for x in bld.env.PYTHONS:
for dirname in bld.env.CFG:
bld(rule = waf_cmd,
cwd = dirname,
always = 1,
python = x,
name = '%s_%s' % (dirname, x))
#if bld.cmd == 'build':
# Logs.info('BUILD STATUS: 0\nACTION PASSED: build') # build farm
# Logs.info('Running action test') # build farm
#Logs.info('testsuite: abc')
#def end(bld):
# Logs.info('testsuite-success: abc')
# Logs.info('TEST STATUS: 0\nACTION FAILED: test')
#bld.add_post_fun(end)
#elif bld.cmd == 'install':
# Logs.info('Running action install') # build farm
# Logs.info('INSTALL STATUS: 0\nACTION PASSED: install') # build farm

View File

@ -2,4 +2,5 @@ Build
-----
.. automodule:: waflib.Build
:members:

View File

@ -2,4 +2,5 @@ ConfigSet
---------
.. automodule:: waflib.ConfigSet
:members:

View File

@ -2,4 +2,5 @@ Configure
---------
.. automodule:: waflib.Configure
:members:

View File

@ -2,4 +2,5 @@ Context
---------
.. automodule:: waflib.Context
:members:

View File

@ -2,4 +2,5 @@ Errors
------
.. automodule:: waflib.Errors
:members:

View File

@ -2,4 +2,5 @@ Logs
----
.. automodule:: waflib.Logs
:members:

View File

@ -2,4 +2,5 @@ Node
----
.. automodule:: waflib.Node
:members:

View File

@ -2,4 +2,5 @@ Options
-------
.. automodule:: waflib.Options
:members:

View File

@ -2,4 +2,5 @@ Runner
------
.. automodule:: waflib.Runner
:members:

View File

@ -2,4 +2,5 @@ Scripting
---------
.. automodule:: waflib.Scripting
:members:

View File

@ -2,4 +2,5 @@ Task
----
.. automodule:: waflib.Task
:members:

View File

@ -2,4 +2,5 @@ TaskGen
-------
.. automodule:: waflib.TaskGen
:members:

View File

@ -2,4 +2,5 @@ Utils
-----
.. automodule:: waflib.Utils
:members:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -49,7 +49,7 @@
<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">Copyright</a><br/>
<span class="linkdescr">Copyright notice</span></p>
<p class="biglink"><a class="biglink" href="https://github.com/waf-project/waf/issues">Reporting bugs</a><br/>
<p class="biglink"><a class="biglink" href="https://gitlab.com/ita1024/waf/issues">Reporting bugs</a><br/>
<span class="linkdescr">Where to report bugs or request new features</span></p>
</td>

View File

@ -3,9 +3,5 @@
About this documentation
------------------------
These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
document processor specifically written for the Python documentation.
.. _reStructuredText: http://docutils.sf.net/rst.html
.. _Sphinx: http://sphinx.pocoo.org/
This is the automatically generated documentation for the Waf project.

View File

@ -21,6 +21,14 @@ sys.path.append(os.path.abspath('.'))
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!
#-----------------------------------------------------------
@ -170,8 +178,9 @@ Configure.ConfigurationContext.__doc__ = """
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
tool_to_features = {}
@ -207,7 +216,7 @@ for x in lst:
tool_to_features[x].append(feat)
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:
txt += "Features defined in this module:"
for feat in sorted(list(set(tool_to_features[x]))):
@ -258,7 +267,8 @@ for z in lst:
for x, y in links:
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 += "\n" + len(title) * '='
@ -347,7 +357,7 @@ master_doc = 'index'
# General information about the project.
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
# |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]).
latex_documents = [
('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
@ -528,7 +538,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'waf', u'waf Documentation',
[u'Thomas Nagy'], 1)
[u'waf.io'], 1)
]
#autodoc_default_flags = ['members', 'no-undoc-members', 'show-inheritance']

View File

@ -132,7 +132,7 @@ The next tools provide support for code generators used in C and C++ projects.
Other compilers and tools
-------------------------
.. _extras: https://github.com/waf-project/waf/tree/master/waflib/extras
.. _extras: https://gitlab.com/ita1024/waf/tree/master/waflib/extras
The following tools provide support for specific compilers or configurations. More tools are present in the extras_ folder, although they are not documented and as stable as the default tools.

View File

@ -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`.
Let's start with a new wscript file in the directory '/tmp/myproject'::
def configure(conf):
def configure(cnf):
print("configure!")
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)
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):
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.
It will then define variables such as:
* ``conf.env.LIB_M = ['m']``
* ``conf.env.CFLAGS_M = ['-Wall']``
* ``conf.env.DEFINES_M = ['var=foo']``
* ``cnf.env.LIB_M = ['m']``
* ``cnf.env.CFLAGS_M = ['-Wall']``
* ``cnf.env.DEFINES_M = ['var=foo']``
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
@ -165,7 +165,7 @@ The declaration can be made more user-friendly by binding new methods to the con
bld.enterprise_program(source='main.c', target='app')
The support code may be turned into a Waf tool by moving it to a separate file.
To ease the deployment, the new Waf tool can even be added to the waf file (see https://github.com/waf-project/waf/blob/master/README#L10).
To ease the deployment, the new Waf tool can even be added to the waf file (see https://gitlab.com/ita1024/waf/blob/master/README.md#L20).
Conclusion
----------

View File

@ -1 +0,0 @@
World.SayHello()

View File

@ -1,3 +0,0 @@
class World:
static def SayHello():
print "hello from boo"

View File

@ -1,6 +0,0 @@
public class World {
public static void SayHello()
{
System.Console.WriteLine("Hello from C#");
}
}

View File

@ -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"
)

View File

@ -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.

View File

@ -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"

View File

@ -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;
}

View File

@ -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')

View File

@ -0,0 +1,68 @@
#! /usr/bin/env python
# encoding: utf-8
# Alibek Omarov, 2019 (a1batross)
import os
from waflib import ConfigSet, Logs
VERSION='0.0.1'
APPNAME='clang_compilation_database_test'
top = '.'
out = 'build'
INCLUDES_TO_TEST = ['common'] # check if include flag appeared in result json
DEFINES_TO_TEST = ['TEST'] # check if definition flag will appear in result json
SOURCE_FILES_TO_TEST = ['a.c', 'b.cpp'] # check if source files are persist in database
def actual_test(bld):
db = bld.bldnode.find_node('compile_commands.json').read_json()
for entry in db:
env = ConfigSet.ConfigSet()
line = ' '.join(entry['arguments'][1:]) # ignore compiler exe, unneeded
directory = entry['directory']
srcname = entry['file'].split(os.sep)[-1] # file name only
bld.parse_flags(line, 'test', env) # ignore unhandled flag, it's harmless for test
if bld.bldnode.abspath() in directory:
Logs.info('Directory test passed')
else:
Logs.error('Directory test failed')
if srcname in SOURCE_FILES_TO_TEST:
Logs.info('Source file test passed')
else:
Logs.error('Source file test failed')
passed = True
for inc in INCLUDES_TO_TEST:
if inc not in env.INCLUDES_test:
passed = False
if passed: Logs.info('Includes test passed')
else: Logs.error('Includes test failed')
passed = True
for define in DEFINES_TO_TEST:
if define not in env.DEFINES_test:
passed = False
if passed: Logs.info('Defines test passed')
else: Logs.error('Defines test failed')
def options(opt):
# check by ./waf clangdb
opt.load('compiler_c compiler_cxx clang_compilation_database')
def configure(conf):
# check if database always generated before build
conf.load('compiler_c compiler_cxx clang_compilation_database')
def build(bld):
bld.shlib(features = 'c cxx', source = SOURCE_FILES_TO_TEST,
defines = DEFINES_TO_TEST,
includes = INCLUDES_TO_TEST,
target = 'test')
bld.add_post_fun(actual_test)

View File

@ -0,0 +1,14 @@
To cross compile for Windows in MSVC mode 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.
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.

View File

@ -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"

View File

@ -0,0 +1,11 @@
#include <Windows.h>
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), "Hello world!\n", 13, NULL, NULL);
return 0;
}

View File

@ -0,0 +1,32 @@
#! /usr/bin/env python
# encoding: utf-8
# DragoonX6 2019
# the following two variables are used by the target "waf dist"
VERSION='0.0.1'
APPNAME='hello_msvc'
top = '.'
from waflib.Configure import conf, ConfigurationContext
from waflib.Options import OptionsContext
def options(opt):
opt.load('clang_cross')
def configure(conf):
conf.load('clang_cross')
if not conf.env.implib_PATTERN == '%s.lib':
conf.fatal('''clang is not configured to compile in msvc mode.
Use flag '--clang-target-triple=x86_64-windows-msvc' to configure.
On Windows you're likely to require running from an MSVC command prompt.
On Linux you will need to have access to a Windows partition with VS installed, and the environment set up properly.
See the ReadMe for more information.''')
conf.env.append_value('CFLAGS', conf.env.CFLAGS_CRT_MULTITHREADED_DLL)
def build(bld):
bld.program(
source = 'hello.c',
target = 'hello_msvc')

View File

@ -43,20 +43,20 @@ def gen(lst, options):
LEN = len(lst)
POP = 3*LEN + 1
popul = [range(LEN) for x in xrange(POP)]
fitn = [0 for x in xrange(POP)]
popul = [range(LEN) for x in range(POP)]
fitn = [0 for x in range(POP)]
def rnd():
return random.randint(0, LEN -1)
def mutate():
for x in xrange(LEN):
for x in range(LEN):
# rotate the previous element by one
v = popul[x+LEN] = popul[x+LEN - 1]
a = v.pop(0)
v.append(a)
for x in xrange(LEN):
for x in range(LEN):
# swap elements
a = rnd()
b = rnd()
@ -66,7 +66,7 @@ def gen(lst, options):
v[a] = v[b]
v[b] = c
for x in xrange(LEN):
for x in range(LEN):
# get one element out, add at the end
v = popul[x+2*LEN]
@ -79,7 +79,7 @@ def gen(lst, options):
best = opti_ref
pos = -1
for x in xrange(len(popul)):
for x in range(len(popul)):
v = popul[x]
arr = [lst[a] for a in v]
tmp = '%s %s' % (cmd, ' '.join(arr))
@ -99,14 +99,14 @@ def gen(lst, options):
assert (sum(popul[x]) == sum(range(LEN)))
#print pos
for x in xrange(len(popul)):
for x in range(len(popul)):
if x == pos:
continue
popul[x] = popul[pos][:]
assert(len(popul[x]) == LEN)
return best
for i in xrange(10000):
for i in range(10000):
mutate()
print(evil())

View File

@ -25,7 +25,7 @@ import random, bz2, os, threading
lock = threading.Lock()
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
gzip = [10000000, 0]

View File

@ -4,14 +4,13 @@
"cuda"
import os
from waflib import Task
from waflib.TaskGen import extension
from waflib.Tools import ccroot, c_preproc
from waflib.Configure import conf
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'
ext_in = ['.h']
vars = ['CCDEPS']
@ -22,9 +21,18 @@ class cuda(Task.Task):
def c_hook(self, node):
return self.create_compiled_task('cuda', node)
@extension('.cpp')
def cxx_hook(self, node):
# override processing for one particular type of file
if getattr(self, 'cuda', False):
return self.create_compiled_task('cuda', node)
else:
return self.create_compiled_task('cxx', node)
def configure(conf):
conf.find_program('nvcc', var='NVCC')
conf.find_cuda_libs()
conf.env.NVCCFLAGS_ST = "--compiler-options=%s"
@conf
def find_cuda_libs(self):
@ -43,7 +51,7 @@ def find_cuda_libs(self):
_includes = node and node.abspath() or ''
_libpath = []
for x in ('lib64', 'lib'):
for x in ('lib64', 'lib64/stubs', 'lib', 'lib/stubs'):
try:
_libpath.append(d.find_node(x).abspath())
except:

5
playground/cuda/test.cpp Normal file
View File

@ -0,0 +1,5 @@
int main()
{
return 0;
}

View File

@ -18,8 +18,12 @@ def configure(conf):
conf.load('cuda', tooldir='.')
# Add a few flags to test proper passing to nvcc
conf.env.CXXFLAGS=['-fPIC', '--std=c++11']
def build(bld):
# cuda application
t = bld.program(
source = 'test.cu main.cpp',
target = 'app',
@ -29,3 +33,18 @@ def build(bld):
# --ptxas-options="-v"
# --ptxas-options="-v -maxrregcount=10"
# -----------------------
# native application
bld.program(
source = 'test.cpp',
target = 'testapp-native')
# cuda application
bld.program(
source = 'test.cpp',
target = 'testapp',
cuda = True,
use = 'CUDA CUDART')

View File

@ -0,0 +1,2 @@
#define bindir "@BINDIR@"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
/* Generated by Cython 0.29 */
#ifndef __PYX_HAVE__cy_cxxtest
#define __PYX_HAVE__cy_cxxtest
@ -12,10 +14,17 @@
#endif
#endif
__PYX_EXTERN_C DL_IMPORT(void) cy_hello(void);
#ifndef DL_IMPORT
#define DL_IMPORT(_T) _T
#endif
__PYX_EXTERN_C void cy_hello(void);
#endif /* !__PYX_HAVE_API__cy_cxxtest */
/* WARNING: the interface of the module init function changed in CPython 3.5. */
/* It now returns a PyModuleDef instance instead of a PyModule instance. */
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcy_cxxtest(void);
#else

View File

@ -1,31 +1,18 @@
/* Generated by Cython 0.29 */
#ifndef __PYX_HAVE_API__cy_cxxtest
#define __PYX_HAVE_API__cy_cxxtest
#include "Python.h"
#include "cy_cxxtest.h"
static void (*__pyx_f_10cy_cxxtest_cy_hello)(void) = 0;
#define cy_hello __pyx_f_10cy_cxxtest_cy_hello
#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
PyObject *py_module = 0;
#if PY_MAJOR_VERSION < 3
py_name = PyString_FromString(name);
#else
py_name = PyUnicode_FromString(name);
#endif
if (!py_name)
goto bad;
py_module = PyImport_Import(py_name);
Py_DECREF(py_name);
return py_module;
bad:
Py_XDECREF(py_name);
return 0;
}
static void (*__pyx_api_f_10cy_cxxtest_cy_hello)(void) = 0;
#define cy_hello __pyx_api_f_10cy_cxxtest_cy_hello
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif
#ifndef __PYX_HAVE_RT_ImportFunction
@ -37,21 +24,20 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**
void (*fp)(void);
void *p;
} tmp;
d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
if (!d)
goto bad;
cobj = PyDict_GetItemString(d, funcname);
if (!cobj) {
PyErr_Format(PyExc_ImportError,
"%s does not export expected C function %s",
"%.200s does not export expected C function %.200s",
PyModule_GetName(module), funcname);
goto bad;
}
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
#if PY_VERSION_HEX >= 0x02070000
if (!PyCapsule_IsValid(cobj, sig)) {
PyErr_Format(PyExc_TypeError,
"C function %s.%s has wrong signature (expected %s, got %s)",
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
goto bad;
}
@ -65,7 +51,7 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**
while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
if (*s1 != *s2) {
PyErr_Format(PyExc_TypeError,
"C function %s.%s has wrong signature (expected %s, got %s)",
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
PyModule_GetName(module), funcname, sig, desc);
goto bad;
}
@ -82,11 +68,12 @@ bad:
}
#endif
static int import_cy_cxxtest(void) {
PyObject *module = 0;
module = __Pyx_ImportModule("cy_cxxtest");
module = PyImport_ImportModule("cy_cxxtest");
if (!module) goto bad;
if (__Pyx_ImportFunction(module, "cy_hello", (void (**)(void))&__pyx_f_10cy_cxxtest_cy_hello, "void (void)") < 0) goto bad;
if (__Pyx_ImportFunction(module, "cy_hello", (void (**)(void))&__pyx_api_f_10cy_cxxtest_cy_hello, "void (void)") < 0) goto bad;
Py_DECREF(module); module = 0;
return 0;
bad:

View File

@ -1,4 +1,7 @@
from cpython.version cimport PY_VERSION
cimport cy_ctest
#cimport commented_import
def pyhello():
cy_ctest.hello()
print("Compiled with python version %s" % PY_VERSION)

View File

@ -1,8 +1,9 @@
from cpython.version cimport PY_VERSION
cimport cy_cxxtest
def pyhello():
cy_cxxtest.hello()
print("Compiled with python version %s" % PY_VERSION)
cdef public api void cy_hello():
print("hello cython-world!")

View File

@ -40,13 +40,13 @@ def build(ctx):
target = 'cxx_lib',
includes = 'cxx_lib')
# first try to build a C-based cython extension
# build a C-based cython extension
ctx(
features = 'c cshlib pyext',
source = 'src/cy_ctest.pyx',
target = 'cy_ctest',
includes = 'c_lib',
use = 'c_lib')
use = 'c_lib')
# then a C++-based one
ctx(
@ -54,7 +54,7 @@ def build(ctx):
source = 'src/cy_cxxtest.pyx',
target = 'cy_cxxtest',
includes = 'cxx_lib',
use = 'cxx_lib')
use = 'cxx_lib')
# a C++ application which uses a C function from a cython module
ctx(
@ -62,5 +62,25 @@ def build(ctx):
source = 'cxx_lib/app.cxx',
target = 'cy-app',
includes = 'cxx_lib src',
use = 'cxx_lib'
)
use = 'cxx_lib')
# ---------------------------------------------------------------
# Testcase for #2244 below
ctx.get_tgen_by_name('cy_ctest').features += ' subst_header_order'
# a generated header for cy_ctest
ctx(
features = 'subst',
source = 'c_lib/extra_dep.h.in',
target = 'c_lib/extra_dep.h',
)
from waflib import TaskGen
@TaskGen.feature('subst_header_order')
@TaskGen.after('process_source')
def set_subst_before_cython_tasks(self):
tg = self.bld.get_tgen_by_name('c_lib/extra_dep.h')
tg.post()
for tsk in self.tasks:
tsk.run_after.add(tg.tasks[-1])

View File

@ -1,3 +0,0 @@
int main() {
return 0;
}

View File

@ -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')

View File

@ -1,9 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <pkg1/exLibC/exLibC.hpp>
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) {
return 0;
} else {

Some files were not shown because too many files have changed in this diff Show More