summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-05 23:54:08 +0800
committerruki <[email protected]>2024-02-05 23:54:08 +0800
commit62f498ded882ce0f43bc7ee287d91c59827a5fa2 (patch)
treeb2e4b2f81e5ba8e5552c2fcb4d610be9b0366b96
parent968d7dc6f05661c381a49e965f56f397cdbb7868 (diff)
impl cosmocc tool
-rw-r--r--xmake/modules/core/tools/cosmocc.lua4
-rw-r--r--xmake/modules/detect/tools/cosmocc/has_flags.lua23
-rw-r--r--xmake/modules/detect/tools/cosmocxx/has_flags.lua23
-rw-r--r--xmake/modules/detect/tools/find_cosmocxx.lua45
4 files changed, 91 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/cosmocc.lua b/xmake/modules/core/tools/cosmocc.lua
index 978b03395..003634995 100644
--- a/xmake/modules/core/tools/cosmocc.lua
+++ b/xmake/modules/core/tools/cosmocc.lua
@@ -26,7 +26,3 @@ function init(self)
_super.init(self)
end
--- make the strip flag
-function nf_strip(self, level)
-end
-
diff --git a/xmake/modules/detect/tools/cosmocc/has_flags.lua b/xmake/modules/detect/tools/cosmocc/has_flags.lua
new file mode 100644
index 000000000..6464e10b6
--- /dev/null
+++ b/xmake/modules/detect/tools/cosmocc/has_flags.lua
@@ -0,0 +1,23 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file has_flags.lua
+--
+
+-- imports
+inherit("detect.tools.gcc.has_flags")
+
diff --git a/xmake/modules/detect/tools/cosmocxx/has_flags.lua b/xmake/modules/detect/tools/cosmocxx/has_flags.lua
new file mode 100644
index 000000000..6464e10b6
--- /dev/null
+++ b/xmake/modules/detect/tools/cosmocxx/has_flags.lua
@@ -0,0 +1,23 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file has_flags.lua
+--
+
+-- imports
+inherit("detect.tools.gcc.has_flags")
+
diff --git a/xmake/modules/detect/tools/find_cosmocxx.lua b/xmake/modules/detect/tools/find_cosmocxx.lua
new file mode 100644
index 000000000..c9a06fb0d
--- /dev/null
+++ b/xmake/modules/detect/tools/find_cosmocxx.lua
@@ -0,0 +1,45 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file find_cosmocxx.lua
+--
+
+-- imports
+import("lib.detect.find_program")
+import("lib.detect.find_programver")
+
+-- find cosmocxx
+--
+-- @param opt the argument options, e.g. {version = true}
+--
+-- @return program, version
+--
+-- @code
+--
+-- local cosmocxx = find_cosmocxx()
+--
+-- @endcode
+--
+function main(opt)
+ opt = opt or {}
+ local program = find_program(opt.program or "cosmoc++", opt)
+ local version = nil
+ if program and opt and opt.version then
+ version = find_programver(program, opt)
+ end
+ return program, version
+end