# CMAKE\_CXX\_MODULE\_STD: cmake cmake v4.3.0-rc1 generate 30 times more targets?

**URL:** https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512
**Category:** Development
**Tags:** os:macos, gen:ninja
**Created:** [February 17, 2026, 9:35pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512 "2026-02-17T21:35:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 17, 2026, 9:35pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512/1 "2026-02-17T21:35:40Z")

</div>

@ben.boeckel the dependency scan seems to be the overkill at the moment?

```bash
bash-5.3$ make release
cmake --preset release --log-level=VERBOSE --fresh
Preset CMake variables:

  BEMAN_USE_MODULES:BOOL="TRUE"
  BEMAN_USE_STD_MODULE:BOOL="TRUE"
  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_CXX_EXTENSIONS:BOOL="TRUE"
  CMAKE_CXX_STANDARD="23"
  CMAKE_CXX_STANDARD_REQUIRED:BOOL="TRUE"
  CMAKE_EXPORT_COMPILE_COMMANDS:BOOL="TRUE"
  CMAKE_INSTALL_MESSAGE="LAZY"
  CMAKE_INSTALL_PREFIX:PATH="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_PREFIX_PATH:STRING="/Users/clausklein/Workspace/cpp/beman-project/execution26/stagedir"
  CMAKE_SKIP_TEST_ALL_DEPENDENCY:BOOL="FALSE"

-- The CXX compiler identification is GNU 15.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++-15 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=/usr/local/Cellar/gcc/15.2.0/include/c++/15;/usr/local/Cellar/gcc/15.2.0/include/c++/15/x86_64-apple-darwin23;/usr/local/Cellar/gcc/15.2.0/include/c++/15/backward;/usr/local/Cellar/gcc/15.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include;/usr/local/Cellar/gcc/15.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include-fixed;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/gcc/15.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin23/15/../../../libstdc++.modules.json
-- BEMAN_USE_MODULES=TRUE
-- BEMAN_USE_STD_MODULE=TRUE
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- CMAKE_CXX_MODULE_STD=ON
-- BEMAN_HAS_IMPORT_STD=ON
-- CMAKE_CXX_SCAN_FOR_MODULES=ON
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- beman-install-library(beman.execution): COMPONENT 'execution'
-- beman_install_library(beman.execution): EXPORT_NAME execution_headers for TARGET 'beman.execution_headers'
-- beman-install-library(beman.execution): 'beman.execution_headers' has INTERFACE_HEADER_SETS=public_headers;detail_headers
-- beman_install_library(beman.execution): EXPORT_NAME execution for TARGET 'beman.execution'
-- beman-install-library(beman.execution): 'beman.execution' has INTERFACE_HEADER_SETS=HEADERS
-- beman-install-library(beman.execution): 'beman.execution' has CXX_MODULE_SETS=CXX_MODULES
-- beman-install-library(beman.execution): Add find_dependency(Threads)
-- Configuring done (10.5s)
-- Generating done (4.2s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/execution26/build/release
ln -fs build/Darwin/release/compile_commands.json .
cmake --workflow --preset release
Executing workflow step 1 of 4: configure preset "release"

-- CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=/usr/local/Cellar/gcc/15.2.0/include/c++/15;/usr/local/Cellar/gcc/15.2.0/include/c++/15/x86_64-apple-darwin23;/usr/local/Cellar/gcc/15.2.0/include/c++/15/backward;/usr/local/Cellar/gcc/15.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include;/usr/local/Cellar/gcc/15.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include-fixed;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/gcc/15.2.0_1/bin/../lib/gcc/current/gcc/x86_64-apple-darwin23/15/../../../libstdc++.modules.json
-- BEMAN_USE_MODULES=TRUE
-- BEMAN_USE_STD_MODULE=TRUE
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- CMAKE_CXX_MODULE_STD=ON
-- BEMAN_HAS_IMPORT_STD=ON
-- CMAKE_CXX_SCAN_FOR_MODULES=ON
-- Configuring done (0.1s)
-- Generating done (4.0s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/execution26/build/release

Executing workflow step 2 of 4: build preset "release"

[13/20815] Scanning /usr/local/Cellar/gcc/15.2.0_1/include/c++/15/bits/std.cc for CXX dependencies^Cmake: *** [build/Darwin/release/compile_commands.json] Interrupt: 2

ninja: build stopped: interrupted by user.
bash-5.3$ 

```

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 17, 2026, 9:42pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512/2 "2026-02-17T21:42:33Z")

</div>

Same environment but with current cmake v4.2.3:

```bash
bash-5.3$ make
/usr/local/bin/cmake -S . -B build -G Ninja \
	 -D CMAKE_EXPERIMENTAL_CXX_IMPORT_STD="d0edc3af-4c50-42ea-a356-e2862fe7a444" \
	 -D BUILD_SHARED_LIBS=YES \
	 -D BEMAN_USE_MODULES=YES \
	 -D BEMAN_USE_STD_MODULE=yes \
	 -D CMAKE_BUILD_TYPE=Release \
	 -D CMAKE_CXX_FLAGS='-fno-inline --coverage' \
	 -D CMAKE_CXX_STANDARD=23 -D CMAKE_CXX_EXTENSIONS=YES -D CMAKE_CXX_STANDARD_REQUIRED=YES \
	 -D CMAKE_INSTALL_MESSAGE=LAZY \
	 -D CMAKE_PROJECT_TOP_LEVEL_INCLUDES=./infra/cmake/use-fetch-content.cmake \
	 -D CMAKE_SKIP_INSTALL_RULES=NO \
	 --log-level=VERBOSE --fresh \
	 # --trace-expand --trace-source=use-fetch-content.cmake \
	 # --debug-find-pkg=GTest
-- The CXX compiler identification is GNU 15.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++-15 - skipped
-- Detecting CXX compile features
CMake Warning (dev) at /usr/local/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake:248 (cmake_language):
  CMake's support for `import std;` in C++23 and newer is experimental. It
  is meant only for experimentation and feedback to CMake developers.
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/CMakeDetermineCompilerSupport.cmake:113 (cmake_create_cxx_import_std)
  /usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:83 (CMAKE_DETERMINE_COMPILER_SUPPORT)
  CMakeLists.txt:11 (project)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Detecting CXX compile features - done
-- CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=/usr/local/Cellar/gcc/15.2.0_1/include/c++/15;/usr/local/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-apple-darwin23;/usr/local/Cellar/gcc/15.2.0_1/include/c++/15/backward;/usr/local/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include;/usr/local/Cellar/gcc/15.2.0_1/lib/gcc/current/gcc/x86_64-apple-darwin23/15/include-fixed;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks
-- BEMAN_USE_MODULES=YES
-- BEMAN_USE_STD_MODULE=yes
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- CMAKE_CXX_MODULE_STD=ON
-- BEMAN_HAS_IMPORT_STD=ON
-- CMAKE_CXX_SCAN_FOR_MODULES=ON
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- beman-install-library(beman.execution): COMPONENT 'execution'
-- beman_install_library(beman.execution): EXPORT_NAME execution_headers for TARGET 'beman.execution_headers'
-- beman-install-library(beman.execution): 'beman.execution_headers' has INTERFACE_HEADER_SETS=public_headers;detail_headers
-- beman_install_library(beman.execution): EXPORT_NAME execution for TARGET 'beman.execution'
-- beman-install-library(beman.execution): 'beman.execution' has INTERFACE_HEADER_SETS=HEADERS
-- beman-install-library(beman.execution): 'beman.execution' has CXX_MODULE_SETS=CXX_MODULES
-- beman-install-library(beman.execution): Add find_dependency(Threads)
-- Configuring done (4.3s)
-- Generating done (0.7s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/execution26/build
ln -sf build/compile_commands.json .
ninja -C build
ninja: Entering directory `build'
[1/689] Scanning /usr/local/Cellar/gcc/15.2.0_1/include/c++/15/bits/std.compat.cc for CXX dependencies^C

bash-5.3$ 

```

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 18, 2026, 9:06pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512/3 "2026-02-18T21:06:49Z")

</div>

### we have 171 cppm files!

```auto
bash-5.3$ cloc .
     565 text files.
     554 unique files.                                          
      14 files ignored.

github.com/AlDanial/cloc v 2.08 T=2.04 s (271.9 files/s, 19178.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 290 2266 1110 11309
C/C++ Header 185 1870 1718 10107
CSS 1 463 125 2235
CMake 33 227 341 1711
Markdown 10 311 11 1695
JSON 9 0 0 1047
Text 3 41 0 737
YAML 11 38 43 586
Python 6 114 22 442
make 1 41 42 156
JavaScript 1 22 36 123
HTML 1 1 16 43
Dockerfile 1 6 5 7
TOML 1 1 0 5
Bourne Shell 1 0 2 2
-------------------------------------------------------------------------------
SUM: 554 5401 3471 30205
-------------------------------------------------------------------------------
bash-5.3$ git ls-files ::*.cppm | wc
    171 171 6735
bash-5.3$ pwd
/Users/clausklein/Workspace/cpp/beman-project/execution26
bash-5.3$ 

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 25, 2026, 8:05pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512/4 "2026-02-25T20:05:42Z")

</div>

I believe this is due to computing a usage hash now. @vito.gamberini

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 27, 2026, 3:43pm UTC](https://discourse.cmake.org/t/cmake-cxx-module-std-cmake-cmake-v4-3-0-rc1-generate-30-times-more-targets/15512/5 "2026-02-27T15:43:36Z")

</div>

See [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/11748](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11748) for an MR for 4.3 to avoid the exponential explosion at least. 4.4 will have a proper implementation that allows those that can share BMIs to do so. See [https://gitlab.kitware.com/cmake/cmake/-/issues/27597](https://gitlab.kitware.com/cmake/cmake/-/issues/27597) for progress on that.
