Repository navigation
Conversation
added 3 commits
October 11, 2026 22:41
- A translation unit may not import and include the same library, so the module entry could not be compiled into BqLogUnitTest beside the include entry: MSVC rejects it with C2300. It is a binary of its own now, started by the test runners right after BqLogUnitTest, so it is still compiled and run by every platform that can build modules. - The library is built once as an object library that both binaries link. - The module target keeps its file set PUBLIC (CMake refuses the import otherwise) and the importing target sets CXX_SCAN_FOR_MODULES, rather than a project wide CMP0155. - The system headers are pre-included in the global module fragment, which now includes bq's assert wrapper: <assert.h> has no include guard, so the purview would include it again and MSVC reports C5244. - type_tools: name the destructor through the nested template's own parameter, which MSVC cannot do through the enclosing T inside a module (C2300). - test_fast_log: strtol instead of sscanf, which is an error in the MSVC test build. - Module test: main() of its own, and it removes the log file of an earlier run, which was otherwise appended to and counted twice.
The changelog gets the module entry back, and the integration guide says that a target which only imports has to set CXX_SCAN_FOR_MODULES (or CMP0155), otherwise the compiler is never told where the compiled module is.
Member
|
pippocao seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The module entry is a binary of its own now. A translation unit may not import and include the same library (MSVC refuses it with C2300), so it cannot be compiled into
BqLogUnitTestnext to the include entry; the test runners start it right afterBqLogUnitTest, which is what keeps it compiled and run on every platform that can build modules.Also in here:
PUBLIC(CMake refuses an import from outside otherwise) and the importing target setsCXX_SCAN_FOR_MODULES, instead of a project wideCMP0155;<assert.h>has no include guard, so the purview includes it again and MSVC reports C5244, which/W4 /WXturns into an error;type_toolsnames the destructor through the nested template's own parameter, which MSVC cannot do through the enclosingTinside a module;test_fast_logusesstrtolinstead of the deprecatedsscanf, which was failing the MSVC test build on its own;main()and removes the log file of an earlier run, which it otherwise appended to and counted twice.Verified locally, both binaries, full suite green: MSVC (VS 18 Insiders,
/W4 /WX) and MinGW GCC 15.2. The module entry reportstest_module 9/9and is idempotent.