Bug 1297471 - Move --enable-ctypes to js/moz.configure. r=chmanchester

--HG--
rename : build/moz.configure/ffi.configure => js/ffi.configure
extra : rebase_source : 99a3956456fb4c39c1f1ad9b7d0f7aaf2c7529ca
This commit is contained in:
Mike Hommey 2016-10-04 14:57:00 +09:00
parent bf4bb1107a
commit a12afd68fa
3 changed files with 31 additions and 29 deletions

View File

@ -205,3 +205,34 @@ def more_deterministic(value):
return True
set_define('JS_MORE_DETERMINISTIC', more_deterministic)
# CTypes
# =======================================================
@depends(building_js, '--help')
def ctypes_default(building_js, _):
return not building_js
js_option('--enable-ctypes', help='Enable js-ctypes',
default=ctypes_default)
build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
set_config('BUILD_CTYPES', build_ctypes)
set_define('BUILD_CTYPES', build_ctypes)
add_old_configure_assignment('BUILD_CTYPES', build_ctypes)
@depends(build_ctypes, building_js)
def js_has_ctypes(ctypes, js):
if ctypes and js:
return True
set_config('JS_HAS_CTYPES', js_has_ctypes)
set_define('JS_HAS_CTYPES', js_has_ctypes)
add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
@depends('--enable-ctypes', '--enable-compile-environment', '--help')
def ctypes_and_compile_environment(ctypes, compile_environment, _):
return ctypes and compile_environment
include_when('ffi.configure', when=ctypes_and_compile_environment)

View File

@ -104,35 +104,6 @@ include_when('build/moz.configure/warnings.configure',
include(include_project_configure)
@depends(building_js, '--help')
def ctypes_default(building_js, _):
return not building_js
js_option('--enable-ctypes', help='Enable js-ctypes',
default=ctypes_default)
build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
set_config('BUILD_CTYPES', build_ctypes)
set_define('BUILD_CTYPES', build_ctypes)
add_old_configure_assignment('BUILD_CTYPES', build_ctypes)
@depends(build_ctypes, building_js)
def js_has_ctypes(ctypes, js):
if ctypes and js:
return True
set_config('JS_HAS_CTYPES', js_has_ctypes)
set_define('JS_HAS_CTYPES', js_has_ctypes)
add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
@depends('--enable-ctypes', '--enable-compile-environment', '--help')
def ctypes_and_compile_environment(ctypes, compile_environment, _):
return ctypes and compile_environment
include_when('build/moz.configure/ffi.configure',
when=ctypes_and_compile_environment)
@dependable
@imports(_from='mozbuild.backend', _import='backends')
def build_backends_choices():