fix vs2022 deps

This commit is contained in:
SoftFever 2023-07-16 00:41:53 +08:00
parent 9253fed401
commit 40a17695c5
8 changed files with 31 additions and 34 deletions

View file

@ -24,7 +24,7 @@ on:
jobs: jobs:
build_win64: build_win64:
name: Build Win64 name: Build Win64
runs-on: windows-2019 runs-on: windows-2022
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -36,11 +36,11 @@ jobs:
- run: mkdir ${{ github.workspace }}/deps/build/OrcaSlicer_dep - run: mkdir ${{ github.workspace }}/deps/build/OrcaSlicer_dep
- name: download deps - name: download deps
shell: powershell shell: powershell
run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/SoftFever/FileSharing/releases/download/OrcaSlicer_deps_Mar/OrcaSlicer_dep_05May2023.zip", "$env:temp\OrcaSlicer_dep_05May2023.zip")' run: '(new-object System.Net.WebClient).DownloadFile("https://github.com/SoftFever/FileSharing/releases/download/4/OrcaSlicer_dep_16Jul2023.zip", "$env:temp\OrcaSlicer_dep_16Jul2023.zip")'
- name: extract deps - name: extract deps
working-directory: ${{ github.workspace }}/deps/build working-directory: ${{ github.workspace }}/deps/build
shell: cmd shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" x %temp%\OrcaSlicer_dep_05May2023.zip' run: '"C:/Program Files/7-Zip/7z.exe" x %temp%\OrcaSlicer_dep_16Jul2023.zip'
- run: dir "${{ github.workspace }}\deps\build\OrcaSlicer_dep" - run: dir "${{ github.workspace }}\deps\build\OrcaSlicer_dep"
@ -63,7 +63,7 @@ jobs:
- name: Build studio - name: Build studio
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: .\build_release.bat studio run: .\build_release_vs2022.bat studio
# - name: pack app # - name: pack app
# working-directory: ${{ github.workspace }}/build # working-directory: ${{ github.workspace }}/build

2
.gitignore vendored
View file

@ -18,7 +18,7 @@ local-lib
/src/TAGS /src/TAGS
/.vscode/ /.vscode/
build-linux/* build-linux/*
deps/build-linux/* deps/build*/*
**/.DS_Store **/.DS_Store
install_* install_*
build_*/ build_*/

View file

@ -1,29 +1,19 @@
# This is a wrapper of FindTBB which prefers the config scripts if available in the system # ported from PrusaSlicer
# but only if building with dynamic dependencies. The config scripts potentially belong
# to TBB >= 2020 which is incompatible with OpenVDB in our static dependency bundle.
# This workaround is useful for package maintainers on Linux systems to use newer versions
# of intel TBB (renamed to oneTBB from version 2021 up).
set(_q "") set(_q "")
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(_q QUIET) set(_q QUIET)
endif() endif()
# Only consider the config scripts if not building with the static dependencies
# and this call is not made from a static dependency build (e.g. dep_OpenVDB will use this module)
# BUILD_SHARED_LIBS will always be defined for dependency projects and will be OFF.
# Newer versions of TBB also discourage from using TBB as a static library
if (NOT SLIC3R_STATIC AND (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS))
find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...") if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
else() if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}") message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...")
endif() else()
message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}")
endif() endif()
endif()
endif ()
if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND) if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in) include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in)

View file

@ -29,11 +29,18 @@ if (APPLE AND IS_CROSS_COMPILE)
${_cmake_openexr_arch} ${_cmake_openexr_arch}
) )
else() else()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch)
else ()
set(_patch_cmd "")
endif ()
bambustudio_add_cmake_project(OpenEXR bambustudio_add_cmake_project(OpenEXR
# GIT_REPOSITORY https://github.com/openexr/openexr.git # GIT_REPOSITORY https://github.com/openexr/openexr.git
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OpenEXR-GCC13.patch PATCH_COMMAND ${_patch_cmd}
DEPENDS ${ZLIB_PKG} DEPENDS ${ZLIB_PKG}
GIT_TAG v2.5.5 GIT_TAG v2.5.5
CMAKE_ARGS CMAKE_ARGS

View file

@ -7,8 +7,9 @@ else()
endif() endif()
bambustudio_add_cmake_project(OpenVDB bambustudio_add_cmake_project(OpenVDB
URL https://github.com/tamasmeszaros/openvdb/archive/refs/tags/v6.2.1-prusa3d.zip #v6.2.1 patched # support vs2022, update to 8.2
URL_HASH SHA256=caf9f0c91976722883ff9cb32420ef142af22f7e625fc643b91c23d6e4172f62 URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON

10
deps/TBB/TBB.cmake vendored
View file

@ -1,12 +1,12 @@
bambustudio_add_cmake_project( bambustudio_add_cmake_project(
TBB TBB
URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz" URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch
CMAKE_ARGS CMAKE_ARGS
-DTBB_BUILD_SHARED=OFF -DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF -DTBB_BUILD_TESTS=OFF
-DTBB_BUILD_TESTS=OFF -DTBB_TEST=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_DEBUG_POSTFIX=_debug -DCMAKE_DEBUG_POSTFIX=_debug
) )

View file

@ -4,7 +4,6 @@
#include <ClipperUtils.hpp> #include <ClipperUtils.hpp>
#include <boost/geometry/index/rtree.hpp> #include <boost/geometry/index/rtree.hpp>
#include <tbb/parallel_for.h> #include <tbb/parallel_for.h>
#include <tbb/atomic.h>
#if defined(_MSC_VER) && defined(__clang__) #if defined(_MSC_VER) && defined(__clang__)
#define BOOST_NO_CXX17_HDR_STRING_VIEW #define BOOST_NO_CXX17_HDR_STRING_VIEW

View file

@ -3580,7 +3580,7 @@ const ExPolygons& TreeSupportData::calculate_avoidance(const RadiusLayerPair& ke
const auto& radius = key.radius; const auto& radius = key.radius;
const auto& layer_nr = key.layer_nr; const auto& layer_nr = key.layer_nr;
BOOST_LOG_TRIVIAL(debug) << "calculate_avoidance on radius=" << radius << ", layer=" << layer_nr<<", recursion="<<key.recursions; BOOST_LOG_TRIVIAL(debug) << "calculate_avoidance on radius=" << radius << ", layer=" << layer_nr<<", recursion="<<key.recursions;
std::pair<tbb::concurrent_unordered_map<RadiusLayerPair, ExPolygons, RadiusLayerPairHash>::iterator,bool> ret; std::pair<tbb::concurrent_unordered_map<RadiusLayerPair, ExPolygons, RadiusLayerPairHash, RadiusLayerPairEquality>::iterator,bool> ret;
constexpr auto max_recursion_depth = 100; constexpr auto max_recursion_depth = 100;
if (key.recursions <= max_recursion_depth*2) { if (key.recursions <= max_recursion_depth*2) {
if (layer_nr == 0) { if (layer_nr == 0) {