aboutsummaryrefslogtreecommitdiffhomepage
path: root/waftools/checks
diff options
context:
space:
mode:
authorGravatar Stefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-04 18:57:29 +0100
committerGravatar Stefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-04 19:31:28 +0100
commitbf90317ad14dde82f16a0f0f3d2561d38ac970ff (patch)
tree8784489fa04851c967814c026b694ce4577b3b6a /waftools/checks
parentaeed84bd2773cf730be0c487c535dcc502249f9b (diff)
build: remove execute kwarg to check_cc when cross-compiling
This prevents waf from running test programs after compilation. A better approach would be to only remove this option if the check actually errors, but we are using this only for Lua anyway.
Diffstat (limited to 'waftools/checks')
-rw-r--r--waftools/checks/custom.py2
-rw-r--r--waftools/checks/generic.py11
2 files changed, 10 insertions, 3 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
index fee56134b4..09a5c01018 100644
--- a/waftools/checks/custom.py
+++ b/waftools/checks/custom.py
@@ -61,7 +61,7 @@ def check_lua(ctx, dependency_identifier):
[lv for lv in lua_versions if lv[0] == ctx.options.LUA_VER]
for lua_version, pkgconfig_query in lua_versions:
- if compose_checks(
+ if compose_checks(
check_pkg_config(pkgconfig_query, uselib_store=lua_version),
check_cc(fragment=fragment,
use=[lua_version] + quvi_lib_storage,
diff --git a/waftools/checks/generic.py b/waftools/checks/generic.py
index 65145ef635..4867b2f355 100644
--- a/waftools/checks/generic.py
+++ b/waftools/checks/generic.py
@@ -1,6 +1,7 @@
import os
from inflectors import DependencyInflector
from waflib.ConfigSet import ConfigSet
+from waflib import Utils
__all__ = [
"check_pkg_config", "check_cc", "check_statement", "check_libs",
@@ -21,6 +22,12 @@ def __merge_options__(dependency_identifier, *args):
[options_accu.update(arg) for arg in args if arg]
return options_accu
+def _filter_cc_arguments(ctx, opts):
+ if ctx.env.DEST_OS != Utils.unversioned_sys_platform():
+ # cross compiling, remove execute=True if present
+ if opts['execute'] == True:
+ opts['execute'] = False
+ return opts
def check_libs(libs, function):
libs = [None] + libs
@@ -42,7 +49,7 @@ def check_statement(header, statement, **kw_ext):
{'fragment':fragment},
__define_options__(dependency_identifier),
kw_ext, kw)
- return ctx.check_cc(**opts)
+ return ctx.check_cc(**_filter_cc_arguments(ctx, opts))
return fn
def check_cc(**kw_ext):
@@ -50,7 +57,7 @@ def check_cc(**kw_ext):
options = __merge_options__(dependency_identifier,
__define_options__(dependency_identifier),
kw_ext, kw)
- return ctx.check_cc(**options)
+ return ctx.check_cc(**_filter_cc_arguments(ctx, options))
return fn
def check_pkg_config(*args, **kw_ext):