Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a18042b
Split scan_view implementation from dependencies
yesmanchyk May 10, 2026
e1d5324
Copied enable-experimental-import-std.cmake from exemplar
yesmanchyk May 10, 2026
a4c5ac4
Implement modules support
yesmanchyk May 10, 2026
a8cd177
Implement modules support in examples
yesmanchyk May 10, 2026
811bc6d
Added new line
yesmanchyk May 10, 2026
f316a48
Fixed test in Clang
yesmanchyk May 10, 2026
6ac8a90
CI for modules
yesmanchyk May 10, 2026
fa8b78b
Apply suggestions from code review
yesmanchyk May 10, 2026
649eebf
Apply suggestions from code review
yesmanchyk May 10, 2026
1e39a97
Fix lint
yesmanchyk May 10, 2026
15fcb10
Fix lint
yesmanchyk May 10, 2026
003dd37
CI version bump
yesmanchyk May 10, 2026
f75a6d1
infra-workflows bump
yesmanchyk May 10, 2026
588de8f
Pass correct flag to use modules
yesmanchyk May 10, 2026
30d2e85
Revert "Split scan_view implementation from dependencies"
yesmanchyk May 10, 2026
12130de
Remove reverted file
yesmanchyk May 10, 2026
f3ca98b
Use compatibility headers
yesmanchyk May 10, 2026
36a3452
Use compatibility headers in tests and examples
yesmanchyk May 10, 2026
f196c4b
Avoid global module fragment
yesmanchyk May 11, 2026
3aef587
beman-submodule update --remote
yesmanchyk May 11, 2026
e7c1aad
Apply suggestions from code review
yesmanchyk May 11, 2026
d41698d
Indent includes
yesmanchyk May 11, 2026
bb40384
clang-format -i include/beman/scan_view/scan.hpp
yesmanchyk May 11, 2026
67d2eb4
Put #include <version> to GMF
yesmanchyk May 12, 2026
ec3b621
Replace size_t with std::size_t
yesmanchyk May 12, 2026
b65932f
Single #include <gtest/gtest.h>
yesmanchyk May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:

jobs:
beman-submodule-check:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.7.2

preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.7.2
with:
matrix_config: >
[
Expand All @@ -31,7 +31,7 @@ jobs:
]

build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.7.2
with:
matrix_config: >
{
Expand All @@ -44,7 +44,7 @@ jobs:
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror", "Debug.Dynamic",
"Debug.Coverage"
"Debug.Coverage", "Debug.-DBEMAN_SCAN_VIEW_USE_MODULES=On"
]
}
]
Expand Down Expand Up @@ -78,7 +78,8 @@ jobs:
{ "stdlibs": ["libstdc++", "libc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror", "Debug.Dynamic"
"Release.MaxSan", "Debug.Werror", "Debug.Dynamic",
"Debug.-DBEMAN_SCAN_VIEW_USE_MODULES=On"
]
}
]
Expand Down Expand Up @@ -135,11 +136,16 @@ jobs:
}

vcpkg-ci:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-ci.yml@1.7.2
with:
port_name: beman-scan-view
feature_combinations: |
Comment thread
yesmanchyk marked this conversation as resolved.
[
{"features": {}},
{"features": {"modules": true}}
]

create-issue-when-fault:
needs: [preset-test, build-and-test]
if: failure() && github.event_name == 'schedule'
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.7.2
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ permissions:

jobs:
pre-commit:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.7.2
2 changes: 1 addition & 1 deletion .github/workflows/vcpkg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [published]
jobs:
vcpkg-release:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.6.0
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-vcpkg-release.yml@1.7.2
with:
port_name: beman-scan-view
secrets:
Expand Down
59 changes: 49 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

cmake_minimum_required(VERSION 3.30...4.3)

include(infra/cmake/enable-experimental-import-std.cmake)

project(
beman.scan_view
DESCRIPTION
Expand All @@ -24,22 +26,59 @@ option(
${PROJECT_IS_TOP_LEVEL}
)

option(
BEMAN_SCAN_VIEW_USE_MODULES
"Provide beman.scan_view as a C++ module"
OFF
)
Comment thread
Mick235711 marked this conversation as resolved.

if(BEMAN_SCAN_VIEW_USE_MODULES)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
endif()

configure_file(
"${PROJECT_SOURCE_DIR}/include/beman/scan_view/config_generated.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/scan_view/config_generated.hpp"
@ONLY
)

# for find of beman_install_library and configure_build_telemetry
include(infra/cmake/beman-install-library.cmake)
include(infra/cmake/BuildTelemetryConfig.cmake)

add_library(beman.scan_view INTERFACE)
if(BEMAN_SCAN_VIEW_USE_MODULES)
add_library(beman.scan_view STATIC)
else()
add_library(beman.scan_view INTERFACE)
endif()
add_library(beman::scan_view ALIAS beman.scan_view)

target_sources(
beman.scan_view
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
)

set_target_properties(
beman.scan_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
)
if(BEMAN_SCAN_VIEW_USE_MODULES)
target_sources(
beman.scan_view
PUBLIC
FILE_SET CXX_MODULES
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(beman.scan_view PROPERTIES CXX_MODULE_STD ON)
target_compile_features(beman.scan_view PUBLIC cxx_std_23)
else()
target_sources(
beman.scan_view
PUBLIC
FILE_SET HEADERS
BASE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
set_target_properties(
beman.scan_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
)
endif()

add_subdirectory(include/beman/scan_view)

Expand Down
6 changes: 6 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ foreach(example ${ALL_EXAMPLES})
beman.scan_view.examples.${example}
PRIVATE beman::scan_view
)
if(BEMAN_SCAN_VIEW_USE_MODULES)
set_target_properties(
beman.scan_view.examples.${example}
PROPERTIES CXX_MODULE_STD ON
)
endif()
endforeach()
20 changes: 15 additions & 5 deletions examples/basic_example.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#include <functional>
#include <iostream>
#include <vector>
#include <beman/scan_view/config.hpp>

#if BEMAN_SCAN_VIEW_USE_MODULES()

import std;

#else

#include <functional>
#include <iostream>
#include <vector>

#if __cpp_lib_print >= 202207L
#include <print>
#endif

#if __cpp_lib_print >= 202207L
#include <print>
#endif

#include <beman/scan_view/scan.hpp>
Expand Down
32 changes: 21 additions & 11 deletions examples/complex_example.cpp
Comment thread
yesmanchyk marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
#include <algorithm>
#include <iostream>
#include <memory>
#include <ranges>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#if __cpp_lib_print >= 202207L
#include <print>
#include <beman/scan_view/config.hpp>

#if BEMAN_SCAN_VIEW_USE_MODULES()

import std;

#else

#include <algorithm>
#include <iostream>
#include <memory>
#include <ranges>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#if __cpp_lib_print >= 202207L
#include <print>
#endif

#endif

#include <beman/scan_view/scan.hpp>
Expand Down
23 changes: 22 additions & 1 deletion include/beman/scan_view/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

target_sources(beman.scan_view PUBLIC FILE_SET HEADERS FILES scan.hpp)
if(BEMAN_SCAN_VIEW_USE_MODULES)
target_sources(
beman.scan_view
PUBLIC
FILE_SET CXX_MODULES FILES scan_view.cppm
FILE_SET HEADERS
FILES
config.hpp
scan.hpp
"${PROJECT_BINARY_DIR}/include/beman/scan_view/config_generated.hpp"
)
else()
target_sources(
beman.scan_view
PUBLIC
FILE_SET HEADERS
FILES
config.hpp
scan.hpp
"${PROJECT_BINARY_DIR}/include/beman/scan_view/config_generated.hpp"
)
endif()
12 changes: 12 additions & 0 deletions include/beman/scan_view/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifndef BEMAN_SCAN_VIEW_CONFIG_HPP
#define BEMAN_SCAN_VIEW_CONFIG_HPP

#if !defined(__has_include) || __has_include(<beman/scan_view/config_generated.hpp>)
#include <beman/scan_view/config_generated.hpp>
#else
#define BEMAN_SCAN_VIEW_USE_MODULES() 0
#endif

#endif
8 changes: 8 additions & 0 deletions include/beman/scan_view/config_generated.hpp.in
Comment thread
Mick235711 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifndef BEMAN_SCAN_VIEW_CONFIG_GENERATED_HPP
#define BEMAN_SCAN_VIEW_CONFIG_GENERATED_HPP

#cmakedefine01 BEMAN_SCAN_VIEW_USE_MODULES()

#endif
Loading
Loading