-
-
Notifications
You must be signed in to change notification settings - Fork 778
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
支持强制包含 #4101
Comments
Title: supports mandatory inclusion |
加了 add_cincludes("config.h")
add_includedirs("$(buildir)/L1")
edit: 还有点问题,需要再改改 |
Added add_cincludes("config.h")
add_includedirs("src") |
改了下,再试试 add_forceincludes("config.h")
add_includedirs("$(buildir)/L1") 默认 add_forceincludes 匹配 c/c++/objc。如果仅仅只想匹配 c++ 可以 add_forceincludes("config.h", {sourcekinds = "cxx"}) 如果想同时匹配多个源文件类型,可以 add_forceincludes("config.h", {sourcekinds = {"cxx", "mxx"}}) |
Change it and try again add_force includes("config.h")
add_includedirs("$(buildir)/L1") By default add_forceincludes matches c/c++/objc. If you only want to match c++ you can add_force includes("config.h", {sourcekinds = "cxx"}) If you want to match multiple source file types at the same time, you can add_force includes("config.h", {sourcekinds = {"cxx", "mxx"}}) |
现在能跑通了, |
Now it works. Can the order in which the files added by |
按添加的先后顺序,就跟 add_defines add_links 什么的类似。 |
According to the order of addition, it is similar to add_defines add_links or something. |
你在什么场景下需要该功能?
墨干项目通过强制包含来引入配置文件,gcc 和 msvc 都支持强制包含选项,而且vscode的C++插件提供了强制包含的配置项。
-include
-include
/FI
--preinclude
, ARM® Compiler armcc User Guide, §8.154-include
, same as gcc, but needing further confirmation.xmake 需要引入新的配置项,并且改进 msvc 插件,从而生成对应的强制包含信息
描述可能的解决方案
set_forceinclude
接口:c_cpp_properties.json
文件描述你认为的候选方案
目前的解决方案:
其他信息
No response
The text was updated successfully, but these errors were encountered: