-
-
Notifications
You must be signed in to change notification settings - Fork 779
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
module和test在一起时报错 #4641
Comments
如果去掉test,运行是正常的 |
Title: module and test report an error together |
If test is removed, the operation is normal. |
最近 modules 在重构,都重构完,会统一看下相关的问题。 |
The modules are being refactored recently. After they are all refactored, we will take a look at the related issues together. |
我这可以的么,给个完整可复现的例子 example ,或者试下最新 dev version。。 add_rules("mode.debug", "mode.release")
set_languages("c++latest")
target("stdmodules_cpp_only")
set_kind("binary")
add_files("src/*.cpp")
set_policy("build.c++.modules", true)
for _, testfile in ipairs(os.files("tests/*.cpp")) do
add_tests(path.basename(testfile), {
files = testfile,
remove_files = "src/main.cpp",
languages = "c++20",
packages = "doctest",
defines = "DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN"})
end D:\projects\personal\xmake\tests\projects\c++\modules\stdmodules_cpp_only>xmake test
checking for Microsoft Visual Studio (x64) version ... 2022
[ 0%]: <stdmodules_cpp_only_main> generating.module.deps tests\main.cpp
[ 0%]: <stdmodules_cpp_only_main> generating.module.deps C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33129\modules\std.ixx
[ 0%]: <stdmodules_cpp_only_main> generating.module.deps C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33129\modules\std.compat.ixx
[ 25%]: <stdmodules_cpp_only_main> compiling.module.release std
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33129\include\chrono(2326): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
[ 37%]: <stdmodules_cpp_only_main> compiling.module.release std.compat
[ 62%]: compiling.release tests\main.cpp
cl: 命令行 warning D9025 :正在重写“/std:c++latest”(用“/std:c++20”)
tests\main.cpp(1): warning C5050: 导入模块“std”时可能不兼容的环境: mismatched C++ versions. Current "202002" module version "202004"
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33129\include\ostream(779): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
[ 75%]: linking.release stdmodules_cpp_only_main.exe
running tests ...
[100%]: stdmodules_cpp_only/main .................................... passed 0.110s
100% tests passed, 0 tests failed out of 1, spent 0.110s |
回去试试 |
Go back and try |
升级一下版本就没这个问题了,已经解决,module里也可以有test了 |
Upgrading the version will eliminate this problem. It has been solved. You can also have tests in the module. |
Xmake Version
2.8.5
Operating System Version and Architecture
win11
Describe Bug
工具链使用msvc, 同时使用xmake和module特性,xmake build报错.
运行xmake build -v, 输出日志:
相当于,既有module,又有测试,看起来好像冲突了.
Expected Behavior
build的时候不报错.
Project Configuration
已给出
Additional Information and Error Logs
已给出
The text was updated successfully, but these errors were encountered: