Closed jingkaimori closed 1 year ago
Bot detected the issue body's language is not English, translate it automatically.
Title: supports mandatory inclusion
加了 add_cincludes
/add_cxxincludes
,但不能指定路径,你只能配合 add_includedirs 来定位。。
add_cincludes("config.h")
add_includedirs("$(buildir)/L1")
xmake update -s github:xmake-io/xmake#includes
edit: 还有点问题,需要再改改
Bot detected the issue body's language is not English, translate it automatically.
Added
add_cincludes
/add_cxxincludes
, but you cannot specify the path, you can only locate it with add_includedirs. .
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"}})
Bot detected the issue body's language is not English, translate it automatically.
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"}})
现在能跑通了,add_forceincludes
添加的各个文件出现在命令行的顺序能控制吗?
Bot detected the issue body's language is not English, translate it automatically.
Now it works. Can the order in which the files added by
add_forceincludes
appear on the command line be controlled?
现在能跑通了,
add_forceincludes
添加的各个文件出现在命令行的顺序能控制吗?
按添加的先后顺序,就跟 add_defines add_links 什么的类似。
Bot detected the issue body's language is not English, translate it automatically.
It works now. Can the order of the files added by
add_forceincludes
appear on the command line be controlled?
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