summaryrefslogtreecommitdiff
path: root/xmake/plugins/check/checkers/api/target
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-02 22:35:45 +0800
committerruki <[email protected]>2023-02-02 22:35:45 +0800
commit3ccae48c676e8a08e811b421676ba682e32ec8a7 (patch)
tree500051a06590e38f7c6fdf8a8091338262c83f88 /xmake/plugins/check/checkers/api/target
parent1804f783f3b7fa873e9a0f745788cf86518dda26 (diff)
improve symbols checker
Diffstat (limited to 'xmake/plugins/check/checkers/api/target')
-rw-r--r--xmake/plugins/check/checkers/api/target/fpmodels.lua26
-rw-r--r--xmake/plugins/check/checkers/api/target/strip.lua26
-rw-r--r--xmake/plugins/check/checkers/api/target/symbols.lua33
3 files changed, 85 insertions, 0 deletions
diff --git a/xmake/plugins/check/checkers/api/target/fpmodels.lua b/xmake/plugins/check/checkers/api/target/fpmodels.lua
new file mode 100644
index 000000000..25c6c239b
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/fpmodels.lua
@@ -0,0 +1,26 @@
+--!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 fpmodels.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("fpmodels", {values = {"none", "precise", "fast", "strict", "except", "noexcept"}})
+end
diff --git a/xmake/plugins/check/checkers/api/target/strip.lua b/xmake/plugins/check/checkers/api/target/strip.lua
new file mode 100644
index 000000000..cf14c607b
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/strip.lua
@@ -0,0 +1,26 @@
+--!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 strip.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("strip", {values = {"none", "debug", "all"}})
+end
diff --git a/xmake/plugins/check/checkers/api/target/symbols.lua b/xmake/plugins/check/checkers/api/target/symbols.lua
new file mode 100644
index 000000000..8f4472a9b
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/symbols.lua
@@ -0,0 +1,33 @@
+--!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 symbols.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("symbols", {values = function (target)
+ local values = {"none", "debug", "hidden", "hidden_cxx"}
+ if target:is_plat("windows") and (target:has_tool("cc", "cl") or target:has_tool("cxx", "cl")) then
+ table.insert(values, "edit")
+ table.insert(values, "embed")
+ end
+ return values
+ end})
+end