Closed yybbwc closed 2 weeks ago
Bot detected the issue body's language is not English, translate it automatically.
Xmake version
2.9.4
win10 LTSC21H1
xmake detected a subproject that I don't want to compile
xmake doesn't detect subprojects I don't want to compile
set_languages("c17", "cxx17")
set_optimize("smallest")
add_cxflags("-Wall")
add_cxflags("-Werror")
add_cxflags("-Wextra")
add_cxflags("-Wpedantic")
add_cxflags("-Wshadow")
add_cxflags("-fomit-frame-pointer")
add_ldflags("-static")
includes("lexilla")
--~ includes("scintilla")
--~ includes("scite")
# xmake -v
checking for mingw directory ... D:/_t/_fmsy/msys2/ucrt64
error: unknown target(scintilla) for lexilla.deps!
。。。好歹给个完整项目 或者 全部 xmake.lua 。。就这么点信息,我要是能猜出来咋回事 就厉害了。
Bot detected the issue body's language is not English, translate it automatically.
. . . At least give me a complete project or all xmake.lua. . With just this bit of information, it would be great if I could guess what's going on.
好。
set_languages("c17", "cxx20")
set_optimize("smallest")
add_cxflags("-Wall")
add_cxflags("-Werror")
add_cxflags("-Wextra")
add_cxflags("-Wpedantic")
add_cxflags("-Wshadow")
add_cxflags("-fomit-frame-pointer")
add_ldflags("-static")
includes("lexilla")
--includes("scintilla")
--includes("scite")
target("lexilla")
set_kind("static")
add_deps("scintilla")
add_files("lexers/*.cxx")
add_files("lexlib/*.cxx")
add_files("src/*.cxx")
add_includedirs("access", {public=true})
add_includedirs("include", {public=true})
add_includedirs("lexlib")
target("scintilla")
add_files("src/*.cxx")
add_files("win32/*.cxx")
add_includedirs("include", {public=true})
add_includedirs("src")
add_syslinks("advapi32")
add_syslinks("gdi32")
add_syslinks("imm32")
add_syslinks("ole32")
add_syslinks("oleaut32")
add_syslinks("stdc++")
add_syslinks("user32")
add_syslinks("uuid")
set_kind("static")
target("scite")
set_kind("binary")
add_defines("LUA_COMPAT_5_3")
add_defines("LUA_UCID")
add_defines("STATIC_BUILD")
add_defines("UNICODE")
add_defines("_UNICODE")
add_defines([[LUA_USER_H="scite_lua_win.h"]])
add_deps("lexilla")
add_deps("scintilla")
add_files("../lexilla/access/*.cxx")
add_files("../scintilla/call/*.cxx")
add_files("lua/src/*.c")
add_files("lua/lpeg/*.c")
add_files("src/*.cxx")
add_files("win32/*.cxx")
add_files("win32/*.rc")
add_includedirs("lua/src")
add_includedirs("src")
add_ldflags("-mwindows")
add_syslinks("advapi32")
add_syslinks("comctl32")
add_syslinks("comdlg32")
add_syslinks("gdi32")
add_syslinks("imm32")
add_syslinks("ole32")
add_syslinks("oleaut32")
add_syslinks("shell32")
add_syslinks("user32")
add_syslinks("uuid")
add_syslinks("uxtheme")
一共四个xmake文件,这下齐了。
Bot detected the issue body's language is not English, translate it automatically.
好。
set_languages("c17", "cxx20")
set_optimize("smallest")
add_cxflags("-Wall")
add_cxflags("-Werror")
add_cxflags("-Wextra")
add_cxflags("-Wpedantic")
add_cxflags("-Wshadow")
add_cxflags("-fomit-frame-pointer")
add_ldflags("-static")
includes("lexilla")
--includes("scintilla")
--includes("scite")
target("lexilla")
set_kind("static")
add_deps("scintilla")
add_files("lexers/*.cxx")
add_files("lexlib/*.cxx")
add_files("src/*.cxx")
add_includedirs("access", {public=true})
add_includedirs("include", {public=true})
add_includedirs("lexlib")
target("scintilla")
add_files("src/*.cxx")
add_files("win32/*.cxx")
add_includedirs("include", {public=true})
add_includedirs("src")
add_syslinks("advapi32")
add_syslinks("gdi32")
add_syslinks("imm32")
add_syslinks("ole32")
add_syslinks("oleaut32")
add_syslinks("stdc++")
add_syslinks("user32")
add_syslinks("uuid")
set_kind("static")
Bot detected the issue body's language is not English, translate it automatically.
There are four xmake files in total, and they are all here.
includes("lexilla") --includes("scintilla") --includes("scite")
我只看到你 includes("lexilla")
,scintilla target 定义所在的 xmake.lua 为啥不去 includes 呢?不然 xmake 咋知道你的 scintilla target 在哪,配置了啥。。
Bot detected the issue body's language is not English, translate it automatically.
includes("lexilla") --includes("scintilla") --includes("scite")
I only saw your includes("lexilla")
. Why not include xmake.lua where scintilla target is defined? Otherwise, how would xmake know where your scintilla target is and what is configured? .
xmake不检测我不希望编译的子项目
感觉你还是没理解 xmake 的机制,决定是否编译,跟你是否 includes 没任何关系。。
即使一个项目中,有 100 个子 xmake.lua 项目,只想默认编译一个,也得全部 includes 进来。。
includes 只是用来引入所有配置定义的,决定哪些 target 默认编译,是通过对 target 设置 set_default(false)
来禁用或者启用的。。
而且你的配置,都把 scintilla 作为 lexilla 的依赖了,那么编译 lexilla ,自然会强制引入 scintilla 编译,不管你怎么禁都是没用的。。既然你不想编译 scintilla,就不要配置 add_deps scintilla 到 lexilla,直接走 add_includedirs 引入对方 includedirs
target("lexilla")
set_kind("static")
add_deps("scintilla")
Bot detected the issue body's language is not English, translate it automatically.
xmake doesn't detect subprojects that I don't want compiled
It feels like you still don't understand the mechanism of xmake. The decision of whether to compile or not has nothing to do with whether you include or not. .
Even if there are 100 sub-xmake.lua projects in a project, and you only want to compile one by default, all of them must be included. .
includes is only used to introduce all configuration definitions. It determines which targets are compiled by default. It is disabled or enabled by setting set_default(false)
to the target. .
Moreover, your configuration uses scintilla as a dependency of lexilla, so compiling lexilla will naturally force the introduction of scintilla compilation. No matter how you disable it, it will be useless. . Since you don't want to compile scintilla, don't configure add_deps scintilla to lexilla, just use add_includedirs to introduce the other party's includedirs
target("lexilla")
set_kind("static")
add_deps("scintilla")
xmake不检测我不希望编译的子项目
感觉你还是没理解 xmake 的机制,决定是否编译,跟你是否 includes 没任何关系。。
即使一个项目中,有 100 个子 xmake.lua 项目,只想默认编译一个,也得全部 includes 进来。。
includes 只是用来引入所有配置定义的,决定哪些 target 默认编译,是通过对 target 设置
set_default(false)
来禁用或者启用的。。而且你的配置,都把 scintilla 作为 lexilla 的依赖了,那么编译 lexilla ,自然会强制引入 scintilla 编译,不管你怎么禁都是没用的。。既然你不想编译 scintilla,就不要配置 add_deps scintilla 到 lexilla,直接走 add_includedirs 引入对方 includedirs
target("lexilla") set_kind("static") add_deps("scintilla")
我明白了
Bot detected the issue body's language is not English, translate it automatically.
xmake doesn't detect subprojects that I don't want compiled
I feel like you still don’t understand the mechanism of xmake. The decision of whether to compile or not has nothing to do with whether you include or not. .
Even if there are 100 sub-xmake.lua projects in a project, and you only want to compile one by default, all of them must be included. .
includes is only used to introduce all configuration definitions. It determines which targets are compiled by default. It is disabled or enabled by setting
set_default(false)
to the target. .Moreover, your configuration uses scintilla as a dependency of lexilla, so compiling lexilla will naturally force the introduction of scintilla compilation. No matter how you disable it, it will be useless. . Since you don't want to compile scintilla, don't configure add_deps scintilla to lexilla, just use add_includedirs to introduce the other party's includedirs
``lua target("lexilla") set_kind("static") add_deps("scintilla")
I see
Xmake 版本
2.9.4
操作系统版本和架构
win10 LTSC21H1
描述问题
xmake检测到了我不希望编译的子项目
期待的结果
xmake不检测我不希望编译的子项目
工程配置
附加信息和错误日志