Giter VIP home page Giter VIP logo

Comments (6)

Issues-translate-bot avatar Issues-translate-bot commented on June 4, 2024

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


Title: plugin.compile_commands.autoupdate does not carry precompiled header information

from xmake.

Issues-translate-bot avatar Issues-translate-bot commented on June 4, 2024

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


At present, it is found that the vscode plug-in behaves normally when it directly calls compile_commands.lua, but the independent startup process behaves abnormally.

from xmake.

MaxwellGengYF avatar MaxwellGengYF commented on June 4, 2024

经过逆向,看起来是 XMAKE_GENERATOR_COMPDB_LSP 这个环境变量的问题,模仿vscode插件内写法:
os.setenv("XMAKE_GENERATOR_COMPDB_LSP", "clangd")
config.load()
_config_targets()
compile_commands.make(compileCommandsDirectory or ".vscode")
就会正确输出pch结果

from xmake.

Issues-translate-bot avatar Issues-translate-bot commented on June 4, 2024

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


After reverse engineering, it seems that the problem is the XMAKE_GENERATOR_COMPDB_LSP environment variable, which imitates the writing method in the vscode plug-in:
os.setenv("XMAKE_GENERATOR_COMPDB_LSP", "clangd")
config.load()
_config_targets()
compile_commands.make(compileCommandsDirectory or ".vscode")
The pch result will be output correctly.

from xmake.

waruqi avatar waruqi commented on June 4, 2024

配置下 lsp 到 clangd 就行了,因为目前已知的,就 clangd 支持 pch,其他的暂时没测试验证过,所以暂时禁用了 pch

add_rules("plugin.compile_commands.autoupdate", { lsp = "clangd", outputdir = ".vscode" })

from xmake.

Issues-translate-bot avatar Issues-translate-bot commented on June 4, 2024

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


Just configure lsp to clangd, because as far as is known, only clangd supports pch, and the others have not been tested and verified, so pch is temporarily disabled.

add_rules("plugin.compile_commands.autoupdate", { lsp = "clangd", outputdir = ".vscode" })

from xmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.