How to set one target to see modules from another? #5229
-
Sorry to bother the community again, but I have minimal examples that are compiled under CMake but do not compile under XMake with CLang. A minimal example builds two targets. Both targets are static libraries, and both export their primary modules. The target2 target imports the primary module from target1, but something is going wrong, and target2 does not see modules from target1.
UPD: I found that test https://github.com/xmake-io/xmake/tree/master/tests/projects/c%2B%2B/modules/user_headerunit2 But it also does not compile. With header units, it fails with header units that are not known, and without header units, with error I receive on my test. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Additionally, the stl_headerunit test from https://github.com/xmake-io/xmake/tree/master/tests/projects/c%2B%2B/modules/stl_headerunit cannot be compiled with clang trunk with the error: "src\hello.mpp:5:8: error: header file (aka '') cannot be imported because it is not known to be a header unit" |
Beta Was this translation helpful? Give feedback.
-
I haven't had time to debug it yet. |
Beta Was this translation helpful? Give feedback.
@kridenberg You should set
{public = true}
to export.ixx
module interfaces for target_1then test_target_2 will get it. see
xmake/tests/projects/c++/modules/staticlib/xmake.lua
Line 6 in 872ddbd