Fix windows non-PCH build

This commit is contained in:
sentientstardust
2026-05-20 03:41:37 +01:00
parent 6646aba3cf
commit b86100aa14
34 changed files with 116 additions and 37 deletions

View File

@@ -12,7 +12,7 @@ on:
build_linux:
description: 'Build Linux AppImage artifacts'
type: boolean
default: false
default: true
build_flatpak:
description: 'Build Linux Flatpak artifacts'
type: boolean
@@ -21,6 +21,10 @@ on:
description: 'Build Windows artifacts'
type: boolean
default: true
build_without_pch_windows:
description: 'Build without PCH (windows)'
type: boolean
default: false
build_macos:
description: 'Build macOS artifacts'
type: boolean
@@ -49,25 +53,26 @@ concurrency:
cancel-in-progress: true
jobs:
build_linux:
strategy:
fail-fast: false
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && ((inputs.build_linux || false) || vars.BUILD_LINUX == 'true') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
build_linux:
strategy:
fail-fast: false
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && (inputs.build_linux || github.event_name != 'workflow_dispatch' || vars.BUILD_LINUX == 'true') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
release-version: ${{ inputs.release_version || '' }}
secrets: inherit
build_windows:
if: ${{ !cancelled() && (inputs.build_windows || github.event_name != 'workflow_dispatch') && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: false
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: false
release-version: ${{ inputs.release_version || '' }}
secrets: inherit
build_without_pch_windows: ${{ inputs.build_without_pch_windows || false }}
secrets: inherit
build_macos_arch:
strategy:
fail-fast: false
@@ -159,7 +164,7 @@ jobs:
name: Unit Tests
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
needs: build_linux
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && ((inputs.build_linux || false) || vars.BUILD_LINUX == 'true') && needs.build_linux.result == 'success' }}
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && (inputs.build_linux || github.event_name != 'workflow_dispatch' || vars.BUILD_LINUX == 'true') && needs.build_linux.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v6

View File

@@ -12,15 +12,19 @@ on:
build-deps-only:
required: false
type: boolean
force-build:
required: false
type: boolean
force-build:
required: false
type: boolean
release-version:
required: false
type: string
default: ''
jobs:
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
check_cache: # determines if there is a cache and outputs variables used in caching process
name: Check Cache
runs-on: ${{ inputs.os }}
@@ -63,7 +67,8 @@ jobs:
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
release-version: ${{ inputs.release-version }}
secrets: inherit
build_without_pch_windows: ${{ inputs.build_without_pch_windows }}
secrets: inherit

View File

@@ -26,6 +26,10 @@ on:
required: false
type: string
default: ''
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
build_deps:
@@ -142,4 +146,5 @@ jobs:
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
release-version: ${{ inputs.release-version }}
build_without_pch_windows: ${{ inputs.build_without_pch_windows }}
secrets: inherit

View File

@@ -21,6 +21,10 @@ on:
required: false
type: string
default: ''
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
build_orca:
@@ -57,8 +61,9 @@ jobs:
useCloudCache: true
- name: Restore sccache cache
id: restore-sccache
if: ${{ !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) }}
uses: actions/cache@v5
uses: actions/cache/restore@v5
with:
path: ${{ env.SCCACHE_DIR }}
key: sccache-orcaslicer-${{ runner.os }}-${{ inputs.arch || 'default' }}-${{ github.sha }}
@@ -364,7 +369,7 @@ jobs:
# env:
# WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
# WindowsSDKVersion: '10.0.26100.0\'
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x -p' || '' }}
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x' || '' }} ${{ !vars.SELF_HOSTED && inputs.build_without_pch_windows && '-p' || '' }}
- name: Show sccache stats Windows
if: ${{ always() && runner.os == 'Windows' && !vars.SELF_HOSTED }}
@@ -473,6 +478,19 @@ jobs:
sccache --show-stats
fi
- name: Stop sccache server
if: ${{ always() && !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) }}
continue-on-error: true
run: sccache --stop-server
- name: Save sccache cache
if: ${{ always() && !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) && steps.restore-sccache.outputs.cache-hit != 'true' && steps.restore-sccache.outputs.cache-primary-key != '' }}
continue-on-error: true
uses: actions/cache/save@v5
with:
path: ${{ env.SCCACHE_DIR }}
key: ${{ steps.restore-sccache.outputs.cache-primary-key }}
# Use tar because upload-artifacts won't always preserve directory structure
# and doesn't preserve file permissions
- name: Upload Test Artifact

View File

@@ -502,10 +502,10 @@ include_directories(SYSTEM ${LIBDIR_BIN}/dev-utils/platform)
include_directories(SYSTEM ${LIBDIR}/libigl)
if(WIN32)
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX)
if(MSVC)
# BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking.
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8 )
add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8 -DBOOST_REGEX_NO_WIN32_LOCALE)
# Force the source code encoding to UTF-8. See OrcaSlicer GH pull request #5583
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

View File

@@ -2,8 +2,12 @@
// Why?
#define _WIN32_WINNT 0x0502
// The standard Windows includes.
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <wchar.h>
#include <commctrl.h>

View File

@@ -1,8 +1,12 @@
// Why?
#define _WIN32_WINNT 0x0502
// The standard Windows includes.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <shellapi.h>
#include <wchar.h>

View File

@@ -1,6 +1,7 @@
#include "BlacklistedLibraryCheck.hpp"
#include <cstdio>
#include <boost/filesystem/path.hpp>
#include <boost/nowide/convert.hpp>
#ifdef WIN32

View File

@@ -4,6 +4,7 @@
#include <queue>
#include <random>
#include <cassert>
#include <numeric>
#include <sstream>
namespace Slic3r
@@ -896,4 +897,3 @@ namespace Slic3r
}

View File

@@ -4,6 +4,7 @@
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
#include <random>
#include <boost/container/small_vector.hpp>

View File

@@ -37,6 +37,7 @@
#include <iomanip>
#include <limits>
#include <map>
#include <numeric>
#include <optional>
#include <set>
#include <sstream>

View File

@@ -19,8 +19,12 @@
#ifdef WIN32
// The standard Windows includes.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <shellapi.h>

View File

@@ -8,6 +8,7 @@
#include <boost/log/trivial.hpp>
#include <random>
#include <algorithm>
#include <numeric>
#include <queue>
#include "libslic3r/AABBTreeLines.hpp"

View File

@@ -21,6 +21,7 @@
#include <cassert>
#include <limits>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <libslic3r.h>

View File

@@ -1,4 +1,6 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "OpenVDBUtils.hpp"
#ifdef _MSC_VER

View File

@@ -6,12 +6,6 @@
#include "PresetBundle.hpp"
#include "AppConfig.hpp"
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#endif /* _MSC_VER */
// instead of #include "slic3r/GUI/I18N.hpp" :
#ifndef L
// !!! If you needed to translate some string,

View File

@@ -25,6 +25,7 @@
#include <array>
#include <cmath>
#include <limits>
#include <numeric>
#include <unordered_set>
#include <boost/filesystem/path.hpp>
#include <boost/format.hpp>

View File

@@ -1,4 +1,5 @@
#include <functional>
#include <numeric>
#include <optional>
#include <libslic3r/OpenVDBUtils.hpp>

View File

@@ -16,6 +16,7 @@
#include "libslic3r.h"
#include <iostream>
#include <numeric>
#include <random>
namespace Slic3r {

View File

@@ -1,4 +1,6 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <libslic3r/SLA/SupportTreeBuilder.hpp>
#include <libslic3r/SLA/SupportTreeBuildsteps.hpp>

View File

@@ -1,3 +1,4 @@
#include <numeric>
#include <unordered_set>
#include <libslic3r/Exception.hpp>

View File

@@ -11,6 +11,7 @@
#include <cmath>
#include <memory>
#include <numeric>
#include <boost/log/trivial.hpp>
#include <boost/container/static_vector.hpp>

View File

@@ -19,6 +19,7 @@
#include "../Utils.hpp"
#include "../format.hpp"
#include <numeric>
#include <string_view>
#include <boost/log/trivial.hpp>

View File

@@ -27,6 +27,7 @@
#include <cassert>
#include <chrono>
#include <fstream>
#include <numeric>
#include <optional>
#include <stdio.h>
#include <string>

View File

@@ -729,6 +729,9 @@ target_include_directories(libslic3r_gui PRIVATE Utils ${CMAKE_CURRENT_BINARY_DI
if (WIN32)
target_include_directories(libslic3r_gui SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../deps/WebView2/include)
target_link_libraries(libslic3r_gui Advapi32)
if (MSVC)
target_compile_options(libslic3r_gui PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FIwx/msw/wrapcctl.h>")
endif()
endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SLIC3R_GUI_SOURCES})

View File

@@ -3,6 +3,7 @@
#include "wx/bitmap.h"
#include "wx/dragimag.h"
#include <wx/panel.h>
namespace Slic3r { namespace GUI {

View File

@@ -8,6 +8,8 @@
#include "CapsuleButton.hpp"
#include "MsgDialog.hpp"
#include <numeric>
namespace Slic3r { namespace GUI {
static bool get_pop_up_remind_flag()

View File

@@ -16,8 +16,12 @@
#if __APPLE__
#import <IOKit/pwr_mgt/IOPMLib.h>
#elif _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include "boost/nowide/convert.hpp"
#endif

View File

@@ -30,6 +30,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/locale/encoding_utf.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/property_tree/ptree.hpp>

View File

@@ -1,6 +1,9 @@
#include "GUI_App.hpp"
#include "InstanceCheck.hpp"
#include "Plater.hpp"
#ifdef _WIN32
#include <Windows.h>
#endif
#include <boost/regex.hpp>
#ifdef _WIN32

View File

@@ -16,6 +16,8 @@
#include "libnest2d/common.hpp"
#include <numeric>
#define SAVE_ARRANGE_POLY 0
namespace Slic3r { namespace GUI {

View File

@@ -11,6 +11,9 @@
#include <boost/endian/conversion.hpp>
#include <boost/log/trivial.hpp>
#include <boost/uuid/detail/md5.hpp>
#ifdef _WIN32
#include <Windows.h>
#endif
#include <boost/regex.hpp>
#include <wx/mstream.h>

View File

@@ -1,5 +1,6 @@
#include "SyncAmsInfoDialog.hpp"
#include <numeric>
#include <thread>
#include <wx/event.h>
#include <wx/sizer.h>

View File

@@ -20,8 +20,12 @@
#ifdef _WIN32
// The standard Windows includes.
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <psapi.h>
#endif /* _WIN32 */