-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Support for dynamic creation and injection of rules and targets #2874
Conversation
@waruqi seem like Ok, doesn't break my projects, but didn't found a way to make my cppfront rule work |
Even though I was able to get the cppfront rules executed first by injecting dependencies, the c++modules dependency scan analysis is not executed in the batchjob, it is still executed early because it is executed during the build batchjob dependency graph phase. rule("cppfront")
set_extensions(".cpp2")
on_load(function (target)
-- modify and replace the builtin rule
local rule = target:rule("c++.build.modules.builder"):clone()
rule:add("deps", "cppfront", {order = true})
target:rule_add(rule)
end)
before_build_file(function (target, sourcefile, opt)
print("build cppfront file")
end)
target("test")
set_kind("binary")
add_rules("cppfront")
set_languages("c++20")
add_files("src/*.cpp", "src/*.mpp")
add_files("src/*.cpp2") here xmake/xmake/rules/c++/modules/xmake.lua Line 60 in 76bced9
[ 0%]: generating.cxx.module.deps src/main.cpp. -> generate module deps, it is not called in batchjob
[ 0%]: generating.cxx.module.deps src/hello.mpp
build cppfront file. -----------------------------------> before build modules and generate headerunits
[ 25%]: generating.cxx.module.bmi hello
[ 62%]: cache compiling.release src/main.cpp
[ 75%]: linking.release test
[100%]: build ok! |
#2866