/** * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ARK_VERSION_H #define ARK_VERSION_H #include #include #include namespace panda { constexpr std::string_view ARK_VERSION_GIT_HASH = "${ARK_VERSION_GIT_HASH}"; constexpr uint32_t ARK_VERSION_MAJOR = 0; constexpr uint32_t ARK_VERSION_MINOR = 0; constexpr uint32_t ARK_VERSION_PATCH = 0; inline void PrintPandaVersion() { std::stringstream ss; ss << "Ark version " << ARK_VERSION_MAJOR << '.' << ARK_VERSION_MINOR << '.' << ARK_VERSION_PATCH << '\n'; if (ARK_VERSION_GIT_HASH.empty()) { ss << "Built from gitless source tree\n"; } else { ss << "Built from git commit " << ARK_VERSION_GIT_HASH << '\n'; } std::cout << ss.str() << std::endl; } inline std::string_view GetPandaVersion() { return ARK_VERSION_GIT_HASH; } } // namespace panda #endif // ARK_VERSION_H