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.
This commit is contained in:
Stefano Pigozzi 2013-12-04 18:57:29 +01:00
parent aeed84bd27
commit bf90317ad1
2 changed files with 10 additions and 3 deletions

View File

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

View File

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