From bf7678ececf50ef69f81d4801a43ef572fcc2933 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 26 Apr 2016 13:30:43 +0800 Subject: add linux platform --- xmake/platforms/linux/checker.lua | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 xmake/platforms/linux/checker.lua (limited to 'xmake/platforms/linux/checker.lua') diff --git a/xmake/platforms/linux/checker.lua b/xmake/platforms/linux/checker.lua new file mode 100644 index 000000000..ee3345bb7 --- /dev/null +++ b/xmake/platforms/linux/checker.lua @@ -0,0 +1,82 @@ +--!The Automatic Cross-platform Build Tool +-- +-- XMake is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published by +-- the Free Software Foundation; either version 2.1 of the License, or +-- (at your option) any later version. +-- +-- XMake is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public License +-- along with XMake; +-- If not, see http://www.gnu.org/licenses/ +-- +-- Copyright (C) 2015 - 2016, ruki All rights reserved. +-- +-- @author ruki +-- @file checker.lua +-- + +-- imports +import("core.tool.tool") +import("platforms.checker", {rootdir = os.programdir()}) + +-- check the architecture +function __check_arch(config) + + -- get the architecture + local arch = config.get("arch") + if not arch then + + -- init the default architecture + config.set("arch", ifelse(config.get("cross"), "none", os.arch())) + + -- trace + print("checking for the architecture ... %s", config.get("arch")) + end +end + +-- check the toolchains +function _check_toolchains(config) + + -- done + checker.check_toolchain(config, "cc", "", "gcc", "the c compiler") + checker.check_toolchain(config, "cxx", "", "g++", "the c++ compiler") + checker.check_toolchain(config, "as", "", "gcc", "the assember") + checker.check_toolchain(config, "ld", "", "g++", "the linker") + checker.check_toolchain(config, "ar", "", "ar", "the static library linker") + checker.check_toolchain(config, "sh", "", "g++", "the shared library linker") +end + +-- init it +function init() + + -- init the check list of config + _g.config = + { + __check_arch + , checker.check_make + , checker.check_ccache + , _check_toolchains + } + + -- init the check list of global + _g.global = + { + checker.check_make + , checker.check_ccache + , _check_ndk_sdkver + } + +end + +-- get the property +function get(name) + + -- get it + return _g[name] +end + -- cgit v1.3.1