fix: SLIC3R_PCH=OFF now builds on Windows, allowing compiler caching (#15552)

This commit is contained in:
Kris Austin
2026-09-06 18:06:18 -03:00
committed by GitHub
parent 0365304ae0
commit 43ce8c5e46
14 changed files with 159 additions and 4 deletions
+3
View File
@@ -916,6 +916,9 @@ endif ()
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE)
elseif (MSVC)
# Puts the Windows headers first when the PCH is off.
target_compile_options(libslic3r_gui PRIVATE "/FIslic3r/win_platform.hpp")
endif ()
if (APPLE)
+1
View File
@@ -3,6 +3,7 @@
#include "wx/bitmap.h"
#include "wx/dragimag.h"
#include "wx/panel.h"
namespace Slic3r { namespace GUI {
+1
View File
@@ -12,6 +12,7 @@
#include "BuildCommit.hpp"
#include "Downloader.hpp"
#include <boost/chrono/duration.hpp>
#include <boost/locale/encoding_utf.hpp>
#include <boost/log/detail/native_typeof.hpp>
#include <libslic3r/Config.hpp>
#include <mutex>
+1 -1
View File
@@ -199,7 +199,7 @@ public:
OptionsGroup(wxWindow *_parent, const wxString &title, const wxString &icon, bool is_tab_opt = false,
column_t extra_clmn = nullptr);
~OptionsGroup() { clear(true); }
virtual ~OptionsGroup() { clear(true); }
wxGridSizer* get_grid_sizer() { return m_grid_sizer; }
const std::vector<Line>& get_lines() { return m_lines; }
+3
View File
@@ -8,6 +8,9 @@
#ifndef wxMediaCtrl3_h
#define wxMediaCtrl3_h
#include <chrono>
#include "wx/window.h"
#include "wx/bitmap.h"
#include "wx/uri.h"
#include "wx/mediactrl.h"
+1
View File
@@ -115,6 +115,7 @@ class UdpSession
{
public:
UdpSession(Bonjour::ReplyFn rfn);
virtual ~UdpSession() = default;
virtual void handle_receive(const boost::system::error_code& error, size_t bytes) = 0;
std::vector<char> buffer;
boost::asio::ip::udp::endpoint remote_endpoint;
+19
View File
@@ -0,0 +1,19 @@
#pragma once
// Force-included into libslic3r_gui when SLIC3R_PCH is OFF, standing in for
// pchheader.hpp, which includes <Windows.h> before anything else. Arriving
// late and transitively, rpcndr.h defines a global `byte` that collides with
// std::byte under `using namespace std`, and the control and URL moniker
// types the GUI uses are never declared.
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <CommCtrl.h>
#include <urlmon.h>
#endif // _WIN32