mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
scripts: waifulib: xcompile: enable cross compilation automatically if CROSS_COMPILE environment variable is set
This commit is contained in:
@@ -541,16 +541,10 @@ def options(opt):
|
||||
help='enable building for Sailfish/Aurora')
|
||||
xc.add_option('--emscripten', action='store_true', dest='EMSCRIPTEN', default = None,
|
||||
help='enable building for Emscripten')
|
||||
xc.add_option('--enable-cross-compile-env', action='store_true', dest='CROSS_COMPILE_ENV', default=None,
|
||||
help='like Kbuild (Linux kernel buildsystem), set toolchain from CROSS_COMPILE variable [default: %(default)s]')
|
||||
|
||||
def configure(conf):
|
||||
if conf.options.CROSS_COMPILE_ENV:
|
||||
try:
|
||||
toolchain_path = conf.environ['CROSS_COMPILE']
|
||||
except KeyError:
|
||||
conf.fatal('Set CROSS_COMPILE environment variable to toolchain prefix (usually in form of path and triplet, ending with -)')
|
||||
|
||||
if 'CROSS_COMPILE' in conf.environ:
|
||||
toolchain_path = conf.environ['CROSS_COMPILE']
|
||||
conf.environ['CC'] = toolchain_path + 'cc'
|
||||
conf.environ['CXX'] = toolchain_path + 'c++'
|
||||
conf.environ['STRIP'] = toolchain_path + 'strip'
|
||||
|
||||
Reference in New Issue
Block a user