Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmake自动生成的 compile_commands.json有问题 #5244

Closed
CofeCofe opened this issue Jun 21, 2024 · 3 comments
Closed

xmake自动生成的 compile_commands.json有问题 #5244

CofeCofe opened this issue Jun 21, 2024 · 3 comments
Labels
Milestone

Comments

@CofeCofe
Copy link
Contributor

Xmake Version

2.9.2

Operating System Version and Architecture

Windows 11

Describe Bug

armclang工具链,xmake f -p cross -a cortex-m4 --toolchain=armclang -c生成工程后,用xmake project -k compile_commands .vscode生成的compile_commands.json文件中,自动生成的argument “-target=arm-arm-none-eabi” 项有问题(一个“-”号)
屏幕截图 2024-06-21 224010
屏幕截图 2024-06-21 224153

Expected Behavior

正确的应该是"--target=arm-arm-none-eabi"(两个”--“号,才正确)

Project Configuration

普通的armclang交叉编译

Additional Information and Error Logs

并非是编译问题

@CofeCofe CofeCofe added the bug label Jun 21, 2024
@CofeCofe
Copy link
Contributor Author

通过更改/path/to_install/xmake/toolchains/armclang/xmake.lua暂时解决了这个问题

            toolchain:add("cxflags", "--target=" .. arch_target)  -- 这行多加了个'-'
            toolchain:add("cxflags", "-mcpu="   .. arch_cpu)
            toolchain:add("asflags", "--target=" .. arch_target)  -- 这行多加了个'-'
            toolchain:add("asflags", "-mcpu="   .. arch_cpu)  --这个之前的问题里有改过
            toolchain:add("ldflags", "--cpu "   .. arch_cpu_ld)

@CofeCofe
Copy link
Contributor Author

@waruqi 看了下官方文档,只有”--target“选项,但是实际编译中也支持”-target“这种形式,但是生成的compile_commands.json就有问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@waruqi After reading the official documentation, there is only the "--target" option, but the actual compilation also supports the "-target" form, but there is a problem with the generated compile_commands.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants