Skip to content

CMake: no scan for C++ modules - #235

Merged
JeromeMartinez merged 1 commit into
MediaArea:masterfrom
JeromeMartinez:CMake_CXX11
Nov 29, 2026
Merged

JeromeMartinez merged 1 commit into
MediaArea:masterfrom
JeromeMartinez:CMake_CXX11

Conversation

@JeromeMartinez

@JeromeMartinez JeromeMartinez commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

From C++20, CMake 3.28+ scans each source for C++ modules before its compilation. The sources don't use C++ modules, and with GCC this scan makes the compilations not cacheable by ccache, so:

  • with CMake 3.28+, the scan is disabled (CXX_SCAN_FOR_MODULES OFF) and the latest C++ standard of the compiler is still used (up to C++26),
  • with older CMake, the latest C++ standard is selected up to C++17.

This also makes the CMake jobs which build this library with compiler cache faster (e.g. in the MediaInfo CI).

The same change is in MediaArea/ZenLib, MediaArea/MediaInfoLib and MediaArea/MediaInfo (branch CMake_CXX11), the CMake module is the same in the three projects.

@JeromeMartinez JeromeMartinez changed the title CMake: C++ standard as the other build systems CMake: latest C++ standard up to C++17 Nov 29, 2026
@JeromeMartinez JeromeMartinez changed the title CMake: latest C++ standard up to C++17 CMake: no scan for C++ modules Nov 29, 2026
@JeromeMartinez
JeromeMartinez merged commit ffe4cd8 into MediaArea:master Nov 29, 2026
18 checks passed
@JeromeMartinez
JeromeMartinez deleted the CMake_CXX11 branch November 29, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant