Closed 19317362 closed 1 month ago
Bot detected the issue body's language is not English, translate it automatically.
Title: Is there any way to add compilation options to the specified file?
add_files("test/*.c", "test2/test2.c", {defines = "TEST2", languages = "c99", includedirs = ".", cflags = "-O0"})
-- 强制禁用 cxflags,cflags 等编译选项的自动检测
add_files("src/*.c", {force = {cxflags = "-DTEST", mflags = "-framework xxx"}})
Bot detected the issue body's language is not English, translate it automatically.
add_files("test/*.c", "test2/test2.c", {defines = "TEST2", languages = "c99", includedirs = ".", cflags = "-O0"}) -- Forcefully disable automatic detection of compilation options such as cxflags, cflags and so on add_files("src/*.c", {force = {cxflags = "-DTEST", mflags = "-framework xxx"}})
你在什么场景下需要该功能?
使用protobuf时,set_warnings("all", "error") 以后,生成的.pb.cc MSVC编译不过
描述可能的解决方案
之前在使用cmake时,可以对 pb.cc 文件增加 "/wd4244 /wd4127 /wd4100 /wd4251 /wd4125" 编译选项来解决这个问题。
使用xmake的话,有没有类似的替代方案
描述你认为的候选方案
No response
其他信息
No response