mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 02:41:17 +00:00
fix: GIT_COMMIT_HASH forces full rebuilds and defeats compiler caching (#15537)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/Color.hpp"
|
||||
#include "BuildCommit.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
@@ -245,7 +246,7 @@ AboutDialog::AboutDialog()
|
||||
vesizer->Add(0, 0, 1, wxEXPAND, FromDIP(5));
|
||||
auto version_string = std::string(SoftFever_VERSION); // _L("Orca Slicer ") + " " + std::string(SoftFever_VERSION);
|
||||
wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", std::string(GIT_COMMIT_HASH)), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", build_commit_label), wxDefaultPosition, wxDefaultSize);
|
||||
credits_string->SetFont(_build_string_font);
|
||||
wxFont version_font = GetFont();
|
||||
version_font = version_font.Scaled(1.85f); // SetPointSize(20) not works on macOS because it uses a 72 PPI reference
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "BuildCommit.hpp"
|
||||
#include "git_commit_hash.h"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
const char *const build_commit_hash = GIT_COMMIT_HASH;
|
||||
const char *const build_commit_label = GIT_COMMIT_HASH GIT_COMMIT_SUFFIX;
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
// Read these rather than including git_commit_hash.h, which changes with every
|
||||
// commit and rebuilds everything that includes it.
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
// The commit alone, safe to use in a commit URL.
|
||||
extern const char *const build_commit_hash;
|
||||
|
||||
// The same, with "-dirty" when the build had uncommitted changes. Use this
|
||||
// wherever the build is shown to a person.
|
||||
extern const char *const build_commit_label;
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "slic3r/GUI/TaskManager.hpp"
|
||||
#include "format.hpp"
|
||||
#include "libslic3r_version.h"
|
||||
#include "BuildCommit.hpp"
|
||||
#include "Downloader.hpp"
|
||||
#include <boost/chrono/duration.hpp>
|
||||
#include <boost/log/detail/native_typeof.hpp>
|
||||
@@ -2580,7 +2581,7 @@ void GUI_App::init_app_config()
|
||||
set_log_path_and_level(log_filename, 3);
|
||||
#endif
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("gui mode, Current OrcaSlicer Version %1% build %2%") % SoftFever_VERSION % GIT_COMMIT_HASH;
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("gui mode, Current OrcaSlicer Version %1% build %2%") % SoftFever_VERSION % build_commit_label;
|
||||
|
||||
//BBS: remove GCodeViewer as seperate APP logic
|
||||
if (!app_config)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "TroubleshootDialog.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include "BuildCommit.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
@@ -137,9 +138,9 @@ TroubleshootDialog::TroubleshootDialog()
|
||||
version->SetFont(version_font);
|
||||
version->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636")));
|
||||
|
||||
auto build = new Button(this, wxString(GIT_COMMIT_HASH));
|
||||
auto build = new Button(this, wxString(build_commit_label));
|
||||
build->SetStyle(ButtonStyle::Regular, ButtonType::Window);
|
||||
auto hash_url = "https://github.com/OrcaSlicer/OrcaSlicer/commit/" + wxString(GIT_COMMIT_HASH);
|
||||
auto hash_url = "https://github.com/OrcaSlicer/OrcaSlicer/commit/" + wxString(build_commit_hash);
|
||||
build->SetToolTip(hash_url);
|
||||
build->Bind(wxEVT_BUTTON, [hash_url](wxCommandEvent &e) {
|
||||
wxLaunchDefaultBrowser(hash_url);
|
||||
@@ -371,7 +372,7 @@ wxString TroubleshootDialog::GetSysInfoAll()
|
||||
{
|
||||
wxString info;
|
||||
info += "Version : " + wxString(SoftFever_VERSION) + "\n"
|
||||
+ "Build : " + wxString(GIT_COMMIT_HASH) + "\n"
|
||||
+ "Build : " + wxString(build_commit_label) + "\n"
|
||||
+ "Package : " + GetPackageType() + "\n"
|
||||
+ "Platform : " + GetOSinfo() + "\n"
|
||||
+ "Processor : " + GetCPUinfo() + "\n"
|
||||
|
||||
Reference in New Issue
Block a user