Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

fix: use inline constexpr in header file #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions configured_files/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// this is a basic example of how a CMake configured file might look
// in this particular case, we are using it to set the version number of our executable
namespace myproject::cmake {
static constexpr std::string_view project_name = "@PROJECT_NAME@";
static constexpr std::string_view project_version = "@PROJECT_VERSION@";
static constexpr int project_version_major { @PROJECT_VERSION_MAJOR@ };
static constexpr int project_version_minor { @PROJECT_VERSION_MINOR@ };
static constexpr int project_version_patch { @PROJECT_VERSION_PATCH@ };
static constexpr int project_version_tweak { @PROJECT_VERSION_TWEAK@ };
static constexpr std::string_view git_sha = "@GIT_SHA@";
inline constexpr std::string_view project_name = "@PROJECT_NAME@";
inline constexpr std::string_view project_version = "@PROJECT_VERSION@";
inline constexpr int project_version_major { @PROJECT_VERSION_MAJOR@ };
inline constexpr int project_version_minor { @PROJECT_VERSION_MINOR@ };
inline constexpr int project_version_patch { @PROJECT_VERSION_PATCH@ };
inline constexpr int project_version_tweak { @PROJECT_VERSION_TWEAK@ };
inline constexpr std::string_view git_sha = "@GIT_SHA@";
}// namespace myproject::cmake

#endif