-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
clang-scan-deps commandline misses target flags on command line #6028
Comments
Title: clang-scan-deps commandline misses target flags on command line |
please provide full project as zip |
if you mark you can remove target("src1")
set_kind("static")
add_rules("include")
add_files("src1/*.cppm") xmake/xmake/rules/c++/modules/xmake.lua Lines 81 to 86 in 897c5ab
src2 {
sourcefiles = {
"src2/main.cpp",
"src1/bar.cppm". <---------------------------
},
rulename = "c++.build.modules.builder",
objectfiles = {
"build/.objs/src2/macosx/x86_64/release/src2/main.cpp.o"
},
dependfiles = {
"build/.deps/src2/macosx/x86_64/release/src2/main.cpp.o.d"
},
sourcekind = "cxx"
} @Arthapz When compiling these files, I think clang-scan-deps should use the flags from the original target dependency. |
Xmake Version
v2.9.7+dev.b029e65ed
Operating System Version and Architecture
Ubuntu 24.10 x86_64
Describe Bug
The Include directories added to the target inside a rule are not added to the flags of clang-scan-deps, resulting in a compile error.
It seems that the added options depend on the first file/target scanned. If target
src2
is removed fromxmake.lua
then the option is added as expected, and the source compiles fine.Expected Behavior
Running
xmake config --toolchain=clang -v
, the include directory added in the rule should be added to the command line ofclang-scan-deps
, too. It works this way for normal C++ compilation units, but not for C++20 modules. The idea here is to have a private include file only used in the module body (e.g. a database file / generated code).Project Configuration
Additional Information and Error Logs
Configuration output:
The text was updated successfully, but these errors were encountered: