diff options
| author | fcying <[email protected]> | 2025-06-22 13:08:01 +0800 |
|---|---|---|
| committer | fcying <[email protected]> | 2025-06-26 09:49:14 +0800 |
| commit | 42e25f69c356dbb014459f472da1e99e27849418 (patch) | |
| tree | f5307ec2275f36abe268b30dae03fc53e158ce0a /xmake/plugins/project/utils/target_utils.lua | |
| parent | 749d449e2ff77f43771467b986aa203546f3a808 (diff) | |
feat(plugin/project): support gen compile_commands.json for specific target
Diffstat (limited to 'xmake/plugins/project/utils/target_utils.lua')
| -rw-r--r-- | xmake/plugins/project/utils/target_utils.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/xmake/plugins/project/utils/target_utils.lua b/xmake/plugins/project/utils/target_utils.lua new file mode 100644 index 000000000..734ad3dee --- /dev/null +++ b/xmake/plugins/project/utils/target_utils.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 target_utils.lua +-- + +-- imports +import("core.project.project") +import("core.base.option") + +-- get project targets +function get_project_targets() + local selected_target = option.get("target") + if selected_target then + -- return table.wrap(project.target(selected_target)) + return { project.target(selected_target) } + end + return project.targets() +end |
