Skip to content

Commit

Permalink
Simplify preprocessor configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickroberts committed Jan 29, 2025
1 parent 4302ac9 commit 264c74f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ else()
)
endif()

string(TOLOWER "${BEMAN_ANY_VIEW_OPTION}" BEMAN_ANY_VIEW_OPTION)

configure_file(
"${PROJECT_SOURCE_DIR}/include/beman/any_view/config.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/any_view/config.hpp"
Expand Down
11 changes: 7 additions & 4 deletions include/beman/any_view/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
#cmakedefine01 BEMAN_ANY_VIEW_USE_COPYABLE()
#cmakedefine01 BEMAN_ANY_VIEW_USE_MOVE_ONLY()

// clang-format off
#define BEMAN_ANY_VIEW_OPTION() @BEMAN_ANY_VIEW_OPTION@
#define BEMAN_ANY_VIEW_OPTION_(suffix) @BEMAN_ANY_VIEW_OPTION@_##suffix
// clang-format on
#if BEMAN_ANY_VIEW_USE_COPYABLE()
#define BEMAN_ANY_VIEW_OPTION() copyable
#define BEMAN_ANY_VIEW_OPTION_(suffix) copyable_##suffix
#elif BEMAN_ANY_VIEW_USE_MOVE_ONLY()
#define BEMAN_ANY_VIEW_OPTION() move_only
#define BEMAN_ANY_VIEW_OPTION_(suffix) move_only_##suffix
#endif

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

Expand Down

0 comments on commit 264c74f

Please sign in to comment.