Skip to content

Commit 264c74f

Browse files
Simplify preprocessor configuration file
1 parent 4302ac9 commit 264c74f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ else()
5858
)
5959
endif()
6060

61-
string(TOLOWER "${BEMAN_ANY_VIEW_OPTION}" BEMAN_ANY_VIEW_OPTION)
62-
6361
configure_file(
6462
"${PROJECT_SOURCE_DIR}/include/beman/any_view/config.hpp.in"
6563
"${PROJECT_BINARY_DIR}/include/beman/any_view/config.hpp"

include/beman/any_view/config.hpp.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
#cmakedefine01 BEMAN_ANY_VIEW_USE_COPYABLE()
1111
#cmakedefine01 BEMAN_ANY_VIEW_USE_MOVE_ONLY()
1212

13-
// clang-format off
14-
#define BEMAN_ANY_VIEW_OPTION() @BEMAN_ANY_VIEW_OPTION@
15-
#define BEMAN_ANY_VIEW_OPTION_(suffix) @BEMAN_ANY_VIEW_OPTION@_##suffix
16-
// clang-format on
13+
#if BEMAN_ANY_VIEW_USE_COPYABLE()
14+
#define BEMAN_ANY_VIEW_OPTION() copyable
15+
#define BEMAN_ANY_VIEW_OPTION_(suffix) copyable_##suffix
16+
#elif BEMAN_ANY_VIEW_USE_MOVE_ONLY()
17+
#define BEMAN_ANY_VIEW_OPTION() move_only
18+
#define BEMAN_ANY_VIEW_OPTION_(suffix) move_only_##suffix
19+
#endif
1720

1821
#define BEMAN_ANY_VIEW_CAT(a, b) a##b
1922

0 commit comments

Comments
 (0)