Skip to content

Commit

Permalink
for MacOs Catlina build
Browse files Browse the repository at this point in the history
  • Loading branch information
vvhh2002 committed Dec 27, 2023
1 parent 7e11aed commit 72e386c
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (APPLE)
if (CMAKE_MACOSX_BUNDLE)
set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks)
endif()
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.softfever3d.orca-slicer")

endif ()
Expand Down Expand Up @@ -369,7 +369,7 @@ endif()
# boost::process was introduced first in version 1.64.0,
# boost::beast::detail::base64 was introduced first in version 1.66.0
set(MINIMUM_BOOST_VERSION "1.66.0")
set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams")
set(_boost_components "system;filesystem;thread;log;regex;chrono;atomic;date_time;iostreams;locale;")
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components})

add_library(boost_libs INTERFACE)
Expand Down
10 changes: 7 additions & 3 deletions deps/Boost/Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ if (WIN32)
else()
set(_boost_url "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz")
set(_boost_hash AEB26F80E80945E82EE93E5939BAEBDCA47B9DEE80A07D3144BE1E1A6A66DD6A)
#set(_boost_url "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz")
#set(_boost_hash 94CED8B72956591C4775AE2207A9763D3600B30D9D7446562C552F0A14A63BE7)
#set(_boost_url "https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz")
#set(_boost_hash a5800f405508f5df8114558ca9855d2640a2de8f0445f051fa1c7c3383045724)
set(_bootstrap_cmd ./bootstrap.sh)
set(_build_cmd ./b2)
set(_build_cmd ./b2 -sICONV_PATH=/opt/local)
endif()

set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/common.jam ./tools/build/src/tools/common.jam)
Expand Down Expand Up @@ -170,10 +174,10 @@ ExternalProject_Add(
URL_HASH SHA256=${_boost_hash}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost
CONFIGURE_COMMAND ./bootstrap.sh
--with-toolset=clang
#--with-toolset=clang
--with-libraries=date_time,filesystem,iostreams,locale,log,regex,system,thread
"--prefix=${DESTDIR}/usr/local"
# PATCH_COMMAND ${_patch_command}
PATCH_COMMAND ${_patch_command}
BUILD_COMMAND "${_build_cmd}"
BUILD_IN_SOURCE ON
INSTALL_COMMAND "${_install_cmd}"
Expand Down
3 changes: 2 additions & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ if (MSVC)
endif ()
elseif (APPLE)
message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
if (CMAKE_OSX_DEPLOYMENT_TARGET)
set(DEP_OSX_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}")
message("OS X Deployment Target: ${DEP_OSX_TARGET}")
Expand Down Expand Up @@ -193,6 +193,7 @@ if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake)
set(ZLIB_PKG dep_ZLIB)
endif ()

set(PNG_PKG "")
if (NOT PNG_FOUND)
include(PNG/PNG.cmake)
Expand Down
3 changes: 2 additions & 1 deletion deps/FREETYPE/FREETYPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif()
orcaslicer_add_cmake_project(FREETYPE
URL https://mirror.ossplanet.net/nongnu/freetype/freetype-2.12.1.tar.gz
URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938
#DEPENDS ${ZLIB_PKG}
DEPENDS ${ZLIB_PKG}
#"${_patch_step}"
CMAKE_ARGS
-D BUILD_SHARED_LIBS=${library_build_shared}
Expand All @@ -22,6 +22,7 @@ orcaslicer_add_cmake_project(FREETYPE
-D FT_DISABLE_PNG=TRUE
-D FT_DISABLE_HARFBUZZ=TRUE
-D FT_DISABLE_BROTLI=TRUE
-D FT_DISABLE_ZLIB=TRUE
)

if(MSVC)
Expand Down
2 changes: 2 additions & 0 deletions deps/PNG/PNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if(APPLE AND IS_CROSS_COMPILE)
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DDISABLE_DEPENDENCY_TRACKING=OFF
-DPNG_BUILD_ZLIB=ON
${_disable_neon_extension}
)
else ()
Expand All @@ -39,6 +40,7 @@ set(_patch_step "")
-DPNG_PREFIX=prusaslicer_
-DPNG_TESTS=OFF
-DDISABLE_DEPENDENCY_TRACKING=OFF
-DPNG_BUILD_ZLIB=ON
${_disable_neon_extension}
)
endif()
Expand Down
8 changes: 6 additions & 2 deletions deps/TIFF/TIFF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ find_package(OpenGL QUIET REQUIRED)
if (APPLE)
message(STATUS "Compiling TIFF for macos ${CMAKE_SYSTEM_VERSION}.")
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
#URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.6.0/libtiff-v4.6.0.zip
#URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
-Djbig:BOOL=OFF
-Dzstd:BOOL=OFF
-Dpixarlog:BOOL=OFF
-Dlerc:BOOL=OFF
-Dlibdeflate:BOOL=OFF
)
else()
orcaslicer_add_cmake_project(TIFF
Expand All @@ -24,6 +27,7 @@ else()
-Djbig:BOOL=OFF
-Dzstd:BOOL=OFF
-Dpixarlog:BOOL=OFF
-Dlerc:BOOL=OFF
)

endif()
Expand Down
6 changes: 6 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"typeinfo": "cpp",
"unordered_set": "cpp"
}
}
82 changes: 82 additions & 0 deletions src/slic3r/GUI/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"files.associations": {
"typeinfo": "cpp",
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__functional_base": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"vector": "cpp"
}
}
2 changes: 1 addition & 1 deletion src/slic3r/GUI/CalibrationPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void SelectMObjectPopup::Popup(wxWindow* WXUNUSED(focus))

if (wxGetApp().is_user_login()) {
if (!get_print_info_thread) {
get_print_info_thread = new boost::thread(Slic3r::create_thread([this, token = std::weak_ptr(m_token)] {
get_print_info_thread = new boost::thread(Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token)] {
NetworkAgent* agent = wxGetApp().getAgent();
unsigned int http_code;
std::string body;
Expand Down
6 changes: 3 additions & 3 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4724,23 +4724,23 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
cancelFn = [this, dlg]() {
return m_is_closing || dlg->WasCanceled();
};
finishFn = [this, userid = m_agent->get_user_id(), dlg, t = std::weak_ptr(m_user_sync_token)](bool ok) {
finishFn = [this, userid = m_agent->get_user_id(), dlg, t = std::weak_ptr<int>(m_user_sync_token)](bool ok) {
CallAfter([=]{
dlg->Destroy();
if (ok && m_agent && t.lock() == m_user_sync_token && userid == m_agent->get_user_id()) reload_settings();
});
};
}
else {
finishFn = [this, userid = m_agent->get_user_id(), t = std::weak_ptr(m_user_sync_token)](bool ok) {
finishFn = [this, userid = m_agent->get_user_id(), t = std::weak_ptr<int>(m_user_sync_token)](bool ok) {
CallAfter([=] {
if (ok && m_agent && t.lock() == m_user_sync_token && userid == m_agent->get_user_id()) reload_settings();
});
};
}

m_sync_update_thread = Slic3r::create_thread(
[this, progressFn, cancelFn, finishFn, t = std::weak_ptr(m_user_sync_token)] {
[this, progressFn, cancelFn, finishFn, t = std::weak_ptr<int>(m_user_sync_token)] {
// get setting list, update setting list
std::string version = preset_bundle->get_vendor_profile_version(PresetBundle::BBL_BUNDLE).to_string();
int ret = m_agent->get_setting_list2(version, [this](auto info) {
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GUI_ObjectTableSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
optgroup->sidetext_width = 5;
optgroup->set_config_category_and_type(GUI::from_u8(group_category), Preset::TYPE_PRINT);

std::weak_ptr weak_optgroup(optgroup);
std::weak_ptr<ConfigOptionsGroup> weak_optgroup(optgroup);
optgroup->m_on_change = [this, is_object, object, config, group_category](const t_config_option_key &opt_id, const boost::any &value) {
this->m_parent->Freeze();
this->update_config_values(is_object, object, config, group_category);
Expand Down
4 changes: 2 additions & 2 deletions src/slic3r/GUI/SelectMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ void SelectMachinePopup::Popup(wxWindow *WXUNUSED(focus))

if (wxGetApp().is_user_login()) {
if (!get_print_info_thread) {
get_print_info_thread = new boost::thread(Slic3r::create_thread([this, token = std::weak_ptr(m_token)] {
get_print_info_thread = new boost::thread(Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token)] {
NetworkAgent* agent = wxGetApp().getAgent();
unsigned int http_code;
std::string body;
Expand Down Expand Up @@ -2833,7 +2833,7 @@ void SelectMachineDialog::update_user_machine_list()
{
NetworkAgent* m_agent = wxGetApp().getAgent();
if (m_agent && m_agent->is_user_login()) {
boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr(m_token)] {
boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token)] {
NetworkAgent* agent = wxGetApp().getAgent();
unsigned int http_code;
std::string body;
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/SendToPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ void SendToPrinterDialog::update_user_machine_list()
{
NetworkAgent* m_agent = wxGetApp().getAgent();
if (m_agent && m_agent->is_user_login()) {
boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr(m_token)] {
boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token)] {
NetworkAgent* agent = wxGetApp().getAgent();
unsigned int http_code;
std::string body;
Expand Down

0 comments on commit 72e386c

Please sign in to comment.