Skip to content

Try to make it works with module#12

Draft
ClausKlein wants to merge 5 commits intoenolan_modules1from
feature/modules1
Draft

Try to make it works with module#12
ClausKlein wants to merge 5 commits intoenolan_modules1from
feature/modules1

Conversation

@ClausKlein
Copy link

@ClausKlein ClausKlein commented Mar 5, 2026

  • BEMAN_USE_MODULES: works
  • BEMAN_USE_STD_MODULE maybe?
  • find-install-rount-trip-test
  • fixed build brew g++-15 on OSX
  • fixed build with brew clang-20 with my workarounds OSX no STD MODULE supported from CMake yet!

Note: the module use an empty FILE_SET HEADERS, with this, the installed package can't be used!

see https://discourse.cmake.org/t/why-are-the-build-and-installed-bmi-files-not-used/15367

and https://discourse.bemanproject.org/t/c-20-modules-in-beman-project-libraries/279/39?u=clausklein

"It is not enough to know, you also have to apply. It's not enough to want, you have to do it.”

@ClausKlein ClausKlein self-assigned this Mar 5, 2026
@ClausKlein ClausKlein marked this pull request as draft March 5, 2026 22:17
@ClausKlein ClausKlein marked this pull request as ready for review March 6, 2026 13:21
@ClausKlein
Copy link
Author

@ednolan If I install only the module library, you see this error If a user want to use it:

bash-5.3$ CXX=clang++ cmake -S . -B build -D BEMAN_USE_MODULES=1 -D CMAKE_CXX_STANDARD=23 -D BEMAN_USE_STD_MODULE=1 -Wdev --log-level=VERBOSE --fresh
-- CXXFLAGS=-stdlib=libc++
'brew' '--prefix' 'llvm'
-- LLVM_DIR=/usr/local/Cellar/llvm/22.1.0
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/llvm/22.1.0/lib/c++/libc++.modules.json
-- The CXX compiler identification is Clang 22.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Cellar/llvm/22.1.0/bin/clang++ - skipped
-- Detecting CXX compile features
CMake Warning (dev) at /Users/clausklein/.direnv/python-3.14/lib/python3.14/site-packages/cmake/data/share/cmake-4.2/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):
  /Users/clausklein/.direnv/python-3.14/lib/python3.14/site-packages/cmake/data/share/cmake-4.2/Modules/CMakeDetermineCompilerSupport.cmake:113 (cmake_create_cxx_import_std)
  /Users/clausklein/.direnv/python-3.14/lib/python3.14/site-packages/cmake/data/share/cmake-4.2/Modules/CMakeTestCXXCompiler.cmake:83 (CMAKE_DETERMINE_COMPILER_SUPPORT)
  CMakeLists.txt:7 (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/llvm/22.1.0/include/c++/v1;/usr/local/Cellar/llvm/22.1.0/lib/clang/22/include;/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include
-- CMAKE_CXX_STDLIB_MODULES_JSON=/usr/local/Cellar/llvm/22.1.0/lib/c++/libc++.modules.json
-- BEMAN_USE_MODULES=1
-- BEMAN_USE_STD_MODULE=1
-- CMAKE_CXX_COMPILER_IMPORT_STD=23;26
-- BEMAN_HAS_IMPORT_STD=ON
Examples to be built: transform_view_direct_usage
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/clausklein/Workspace/cpp/beman-project/transform_view/examples/build
bash-5.3$ ninja -C build/
ninja: Entering directory `build/'
[2/12] Scanning /Users/clausklein/.local/lib/cmake/beman.transform_view/modules/transform_view.cppm for CXX dependencies
FAILED: [code=1] CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi 
"/usr/local/Cellar/llvm/22.1.0/bin/clang-scan-deps" -format=p1689 -- /usr/local/Cellar/llvm/22.1.0/bin/clang++ -DBEMAN_HAS_IMPORT_STD -DBEMAN_HAS_MODULES -I/usr/local/Cellar/llvm/22.1.0/include -I/usr/local/Cellar/llvm/22.1.0/include/c++/v1 -I/usr/local/Cellar/llvm/22.1.0/lib/clang/22/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include -isystem /Users/clausklein/.local/include -stdlib=libc++ -std=gnu++26 -stdlib=libc++ --precompile -x c++ /Users/clausklein/.local/lib/cmake/beman.transform_view/modules/transform_view.cppm -c -o CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi -resource-dir "/usr/local/Cellar/llvm/22.1.0/lib/clang/22" -MT CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi -MD -MF CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi.d > CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi.tmp && mv CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi.tmp CMakeFiles/beman__transform_view_module@synth_50bb36f7aaa7.dir/e891b98e2521.bmi.ddi
warning: argument unused during compilation: '-c'
Diagnostics while scanning dependencies for '/Users/clausklein/.local/lib/cmake/beman.transform_view/modules/transform_view.cppm':
warning: argument unused during compilation: '-c'
/Users/clausklein/.local/lib/cmake/beman.transform_view/modules/transform_view.cppm:16:10: fatal error: 'beman/transform_view/transform_view.hpp' file not found
[3/12] Scanning /usr/local/Cellar/llvm/22.1.0/share/libc++/v1/std.cppm for CXX dependencies
ninja: build stopped: subcommand failed.
bash-5.3$```

@ClausKlein ClausKlein marked this pull request as draft March 6, 2026 21:19
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