Skip to content

Conversation

@ClausKlein
Copy link
Collaborator

Create and install an interface libray and the CXX_MODULE if possible

Available CMake options:

BEMAN_EXECUTION_BUILD_EXAMPLES:BOOL=ON
BEMAN_EXECUTION_ENABLE_INSTALL:BOOL=ON
BEMAN_EXECUTION_ENABLE_TESTING:BOOL=ON
BEMAN_HAS_IMPORT_STD:BOOL=ON
# -> "Build with import std; is possible and used!"

if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
    option(BEMAN_USE_MODULES "Build CXX_MODULES" ${CMAKE_CXX_SCAN_FOR_MODULES})
endif()
if(BEMAN_USE_MODULES)
    target_compile_definitions(beman_execution PUBLIC BEMAN_HAS_MODULES)
endif()

BEMAN_USE_STD_MODULE:BOOL=ON
# -> "Check if 'import std;' is possible with the toolchain?"

if(BEMAN_USE_MODULES AND CMAKE_CXX_MODULE_STD)
    target_compile_definitions(beman_execution PUBLIC BEMAN_HAS_IMPORT_STD)
endif()

Exported CMake targets:

beman_execution imported as beman::beman_execution
beman_execution_headers imported as beman::beman_execution_headers

Installed CMAKE config package:

bash-5.3$ cpack
CPack: Create package using TGZ
CPack: Install projects
CPack: - Install project: beman_execution []
CPack: Create package
CPack: - package: gcc-release/beman_execution-0.0.1-Darwin.tar.gz generated.
bash-5.3$ tree _CPack_Packages/Darwin/TGZ/beman_execution-0.0.1-Darwin/lib/cmake/
_CPack_Packages/Darwin/TGZ/beman_execution-0.0.1-Darwin/lib/cmake/
└── beman_execution
    ├── beman_execution-config-targets-relwithdebinfo.cmake
    ├── beman_execution-config-targets.cmake
    ├── beman_execution-config-version.cmake
    ├── beman_execution-config.cmake
    ├── cxx-modules-beman_execution-config-targets-RelWithDebInfo.cmake
    ├── cxx-modules-beman_execution-config-targets.cmake
    ├── module
    │   └── execution.cppm
    └── target-beman__execution-RelWithDebInfo.cmake

3 directories, 8 files
bash-5.3$

@ClausKlein
Copy link
Collaborator Author

ClausKlein commented Jan 30, 2026

@dietmarkuehl ninja examples/all and and ninja all_verify_interface_header_sets build fine

but some tests fails to build with import beman.execution;!

only this tests fail to compile:

tests/beman/execution/exec-affine-on.test.cpp
tests/beman/execution/issue-174.test.cpp
tests/beman/execution/issue-186.test.cpp
tests/beman/execution/exec-scope-counting.test.cpp
tests/beman/execution/exec-prop.test.cpp
tests/beman/execution/exec-env.test.cpp
tests/beman/execution/exec-scope-simple-counting.test.cpp
tests/beman/execution/exec-scope-concepts.test.cpp
tests/beman/execution/issue-144.test.cpp
tests/beman/execution/exec-awaitable.test.cpp
tests/beman/execution/exec-fwd-env.test.cpp
tests/beman/execution/exec-general.test.cpp
tests/beman/execution/exec-get-compl-sched.test.cpp
tests/beman/execution/exec-get-delegation-scheduler.test.cpp
tests/beman/execution/exec-get-domain.test.cpp
tests/beman/execution/exec-get-env.test.cpp
tests/beman/execution/exec-get-scheduler.test.cpp
tests/beman/execution/exec-get-stop-token.test.cpp
tests/beman/execution/exec-getcomplsigs.test.cpp
tests/beman/execution/exec-into-variant.test.cpp
tests/beman/execution/exec-let.test.cpp
tests/beman/execution/exec-opstate-start.test.cpp
tests/beman/execution/exec-opstate.test.cpp
tests/beman/execution/exec-read-env.test.cpp
tests/beman/execution/exec-run-loop-general.test.cpp
tests/beman/execution/exec-run-loop-types.test.cpp
tests/beman/execution/exec-sched.test.cpp
tests/beman/execution/exec-schedule-from.test.cpp
tests/beman/execution/exec-schedule.test.cpp
tests/beman/execution/exec-set-error.test.cpp
tests/beman/execution/exec-set-stopped.test.cpp
tests/beman/execution/exec-set-value.test.cpp
tests/beman/execution/exec-snd-apply.test.cpp
tests/beman/execution/exec-snd-transform.test.cpp
tests/beman/execution/exec-starts-on.test.cpp
tests/beman/execution/exec-sync-wait.test.cpp
tests/beman/execution/exec-then.test.cpp
tests/beman/execution/exec-when-all.test.cpp
tests/beman/execution/exec-with-awaitable-senders.test.cpp
tests/beman/execution/exec-bulk.test.cpp
tests/beman/execution/function-objects.test.cpp
tests/beman/execution/stopcallback-cons.test.cpp
tests/beman/execution/stopcallback-general.test.cpp
tests/beman/execution/stopcallback-inplace-cons.test.cpp
tests/beman/execution/stopcallback-inplace-general.test.cpp
tests/beman/execution/stopcallback-inplace.test.cpp
tests/beman/execution/stopcallback.test.cpp
tests/beman/execution/stopsource-cons.test.cpp
tests/beman/execution/stopsource-general.test.cpp
tests/beman/execution/stopsource-inplace-cons.test.cpp
tests/beman/execution/stopsource-inplace-general.test.cpp
tests/beman/execution/stopsource-inplace-mem.test.cpp
tests/beman/execution/stopsource-mem.test.cpp
tests/beman/execution/stoptoken-general.test.cpp
tests/beman/execution/stoptoken-inplace-general.test.cpp
tests/beman/execution/stoptoken-inplace-members.test.cpp
tests/beman/execution/stoptoken-mem.test.cpp
tests/beman/execution/stoptoken-never-general.test.cpp
tests/beman/execution/thread-stoptoken-intro.test.cpp

CMakeLists.txt Outdated
${CMAKE_CURRENT_BINARY_DIR}/beman/execution/modules_export.hpp
)
target_compile_definitions(beman_execution PUBLIC BEMAN_USE_MODULES)
target_compile_definitions(beman_execution PUBLIC BEMAN_HAS_MODULES)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dietmarkuehl I may comment this out for now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge the PR onto the branch about nowish. ... and I can comment that line out if that is all what's needed. On the other hand, I want to make sure I test module building when meddling with the script.

@dietmarkuehl dietmarkuehl merged commit 69e8036 into bemanproject:mk-module Jan 30, 2026
32 checks passed
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.

2 participants