mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
build: Make sure changing commit hash doesn't trigger a full rebuild
Closes #1137
This commit is contained in:
@@ -83,7 +83,8 @@ if (WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition -fvisibility=hidden")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE IMHEX_VERSION="${IMHEX_VERSION_STRING}")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
setupCompilerFlags(${PROJECT_NAME})
|
||||
|
||||
|
||||
@@ -49,12 +49,9 @@ namespace hex::plugin::builtin {
|
||||
ImGui::TextUnformatted("hex.builtin.welcome.server_contact.data_collected.version"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextFormattedWrapped("{}\n{}@{}\n{}",
|
||||
IMHEX_VERSION,
|
||||
#if defined (GIT_COMMIT_HASH_LONG) && defined (GIT_BRANCH)
|
||||
GIT_COMMIT_HASH_LONG, GIT_BRANCH,
|
||||
#else
|
||||
"??", "??",
|
||||
#endif
|
||||
ImHexApi::System::getImHexVersion(),
|
||||
ImHexApi::System::getCommitHash(true),
|
||||
ImHexApi::System::getCommitBranch(),
|
||||
ImHexApi::System::isPortableVersion() ? "Portable" : "Installed"
|
||||
);
|
||||
|
||||
|
||||
@@ -17,15 +17,9 @@ namespace hex::plugin::builtin {
|
||||
nlohmann::json result;
|
||||
|
||||
result["build"] = {
|
||||
{ "version", IMHEX_VERSION },
|
||||
|
||||
#if defined(GIT_COMMIT_HASH_LONG)
|
||||
{ "commit", GIT_COMMIT_HASH_LONG },
|
||||
#endif
|
||||
|
||||
#if defined(GIT_BRANCH)
|
||||
{ "branch", GIT_BRANCH },
|
||||
#endif
|
||||
{ "version", ImHexApi::System::getImHexVersion() },
|
||||
{ "commit", ImHexApi::System::getCommitHash(true) },
|
||||
{ "branch", ImHexApi::System::getCommitBranch() }
|
||||
};
|
||||
|
||||
std::vector<std::string> commands;
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
{
|
||||
const auto metadataContent = hex::format("{}\n{}", MetadataHeaderMagic, IMHEX_VERSION);
|
||||
const auto metadataContent = hex::format("{}\n{}", MetadataHeaderMagic, ImHexApi::System::getImHexVersion());
|
||||
tar.writeString(MetadataPath, metadataContent);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,11 @@ namespace hex::plugin::builtin {
|
||||
ImGui::Image(this->m_logoTexture, scaled({ 64, 64 }));
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::TextFormatted("ImHex Hex Editor v{} by WerWolv - " ICON_FA_CODE_BRANCH, IMHEX_VERSION);
|
||||
ImGui::TextFormatted("ImHex Hex Editor v{} by WerWolv - " ICON_FA_CODE_BRANCH, ImHexApi::System::getImHexVersion());
|
||||
|
||||
#if defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH_SHORT) && defined(GIT_COMMIT_HASH_LONG)
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Hyperlink(hex::format("{0}@{1}", GIT_BRANCH, GIT_COMMIT_HASH_SHORT).c_str()))
|
||||
hex::openWebpage("https://github.com/WerWolv/ImHex/commit/" GIT_COMMIT_HASH_LONG);
|
||||
#endif
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Hyperlink(hex::format("{0}@{1}", ImHexApi::System::getCommitBranch(), ImHexApi::System::getCommitHash()).c_str()))
|
||||
hex::openWebpage("https://github.com/WerWolv/ImHex/commit/" + ImHexApi::System::getCommitHash(true));
|
||||
|
||||
ImGui::TextUnformatted("hex.builtin.view.help.about.translator"_lang);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user