Initial commit for the builder

This commit is contained in:
Aidan Case
2024-02-18 22:27:09 -06:00
parent f9849d1302
commit 08e687e2ac
22 changed files with 3047 additions and 13 deletions

View File

@@ -0,0 +1,167 @@
From df46add1165314bce93d70e611ddc453561ffb60 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 12 Jun 2023 20:28:35 -0400
Subject: [PATCH] Add support for building WebView with libwebkit2gtk-4.1
libwebkit2gtk-4.1 has the same API as libwebkit2gtk-4.0, except that the
former links with libsoup-3.0 and the latter links with libsoup-2.4.
Fixes #23630.
(cherry picked from commit 1b8664426603376b68f8ca3c54de97ec630e5940)
---
build/cmake/init.cmake | 10 ++-
build/cmake/modules/FindLIBSOUP.cmake | 14 +++-
build/cmake/modules/FindWEBKIT2.cmake | 5 +-
configure | 95 +++++++++++++++++++++++++--
configure.in | 16 ++++-
src/gtk/webview_webkit2.cpp | 4 ++
6 files changed, 129 insertions(+), 15 deletions(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index fc206cf2e03a..5d88a7e487cc 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -453,15 +453,21 @@ if(wxUSE_GUI)
if(wxUSE_WEBVIEW)
if(WXGTK)
if(wxUSE_WEBVIEW_WEBKIT)
- find_package(LIBSOUP)
+ set(WEBKIT_LIBSOUP_VERSION 2.4)
if(WXGTK2)
find_package(WEBKIT 1.0)
elseif(WXGTK3)
- find_package(WEBKIT2)
+ find_package(WEBKIT2 4.1 QUIET)
+ if(WEBKIT2_FOUND)
+ set(WEBKIT_LIBSOUP_VERSION 3.0)
+ else()
+ find_package(WEBKIT2 4.0)
+ endif()
if(NOT WEBKIT2_FOUND)
find_package(WEBKIT 3.0)
endif()
endif()
+ find_package(LIBSOUP ${WEBKIT_LIBSOUP_VERSION})
endif()
set(wxUSE_WEBVIEW_WEBKIT OFF)
set(wxUSE_WEBVIEW_WEBKIT2 OFF)
diff --git a/build/cmake/modules/FindLIBSOUP.cmake b/build/cmake/modules/FindLIBSOUP.cmake
index cbfba1cf9366..2433d141eaf7 100644
--- a/build/cmake/modules/FindLIBSOUP.cmake
+++ b/build/cmake/modules/FindLIBSOUP.cmake
@@ -31,19 +31,27 @@
# LibSoup does not provide an easy way to retrieve its version other than its
# .pc file, so we need to rely on PC_LIBSOUP_VERSION and REQUIRE the .pc file
# to be found.
+SET(LIBSOUP_VERSION 2.4)
+if(DEFINED LIBSOUP_FIND_VERSION)
+ SET(LIBSOUP_VERSION ${LIBSOUP_FIND_VERSION})
+endif()
+
+set(LIBSOUP_INCLUDE_DIRS LIBSOUP_INCLUDE_DIRS-NOTFOUND)
+set(LIBSOUP_LIBRARIES LIBSOUP_LIBRARIES-NOTFOUND)
+
FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-2.4)
+PKG_CHECK_MODULES(PC_LIBSOUP QUIET libsoup-${LIBSOUP_VERSION})
if(PC_LIBSOUP_FOUND)
FIND_PATH(LIBSOUP_INCLUDE_DIRS
NAMES libsoup/soup.h
HINTS ${PC_LIBSOUP_INCLUDEDIR}
${PC_LIBSOUP_INCLUDE_DIRS}
- PATH_SUFFIXES libsoup-2.4
+ PATH_SUFFIXES libsoup-${LIBSOUP_VERSION}
)
FIND_LIBRARY(LIBSOUP_LIBRARIES
- NAMES soup-2.4
+ NAMES soup-${LIBSOUP_VERSION}
HINTS ${PC_LIBSOUP_LIBDIR}
${PC_LIBSOUP_LIBRARY_DIRS}
)
diff --git a/build/cmake/modules/FindWEBKIT2.cmake b/build/cmake/modules/FindWEBKIT2.cmake
index 133e7a4563ea..e39077ac4a71 100644
--- a/build/cmake/modules/FindWEBKIT2.cmake
+++ b/build/cmake/modules/FindWEBKIT2.cmake
@@ -5,7 +5,10 @@
# WEBKIT2_LIBRARIES - List of libraries when using Webkit2.
# WEBKIT2_FOUND - True if Webkit2 found.
-SET( WEBKIT2_VERSION 4.0)
+SET(WEBKIT2_VERSION 4.0)
+if(DEFINED WEBKIT2_FIND_VERSION)
+ SET(WEBKIT2_VERSION ${WEBKIT2_FIND_VERSION})
+endif()
set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND)
set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND)
diff --git a/configure.in b/configure.in
index 957be8dda34c..257c95a6009b 100644
--- a/configure.in
+++ b/configure.in
@@ -7529,15 +7529,27 @@ if test "$wxUSE_WEBVIEW" = "yes"; then
if test "$wxUSE_GTK" = 1; then
if test "$WXGTK3" = 1; then
PKG_CHECK_MODULES([WEBKIT],
- [webkit2gtk-4.0],
+ [webkit2gtk-4.1],
[
USE_WEBVIEW_WEBKIT2=1
CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS"
EXTRALIBS_WEBVIEW="$WEBKIT_LIBS"
],
[
- AC_MSG_WARN([webkit2gtk not found, falling back to webkitgtk])
+ AC_MSG_WARN([webkit2gtk-4.1 not found, falling back to webkit2gtk-4.0])
])
+ if test "$USE_WEBVIEW_WEBKIT2" = 0; then
+ PKG_CHECK_MODULES([WEBKIT],
+ [webkit2gtk-4.0],
+ [
+ USE_WEBVIEW_WEBKIT2=1
+ CXXFLAGS="$CXXFLAGS $WEBKIT_CFLAGS"
+ EXTRALIBS_WEBVIEW="$WEBKIT_LIBS"
+ ],
+ [
+ AC_MSG_WARN([webkit2gtk-4.0 not found, falling back to webkitgtk])
+ ])
+ fi
fi
if test "$USE_WEBVIEW_WEBKIT2" = 0; then
webkitgtk=webkit-1.0
diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp
index 191cbcf2cc18..87a9bd5ad3a8 100644
--- a/src/gtk/webview_webkit2.cpp
+++ b/src/gtk/webview_webkit2.cpp
@@ -173,15 +173,18 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *,
{
switch (error->code)
{
+#if SOUP_MAJOR_VERSION < 3
case SOUP_STATUS_CANCELLED:
type = wxWEBVIEW_NAV_ERR_USER_CANCELLED;
break;
case SOUP_STATUS_CANT_RESOLVE:
+#endif
case SOUP_STATUS_NOT_FOUND:
type = wxWEBVIEW_NAV_ERR_NOT_FOUND;
break;
+#if SOUP_MAJOR_VERSION < 3
case SOUP_STATUS_CANT_RESOLVE_PROXY:
case SOUP_STATUS_CANT_CONNECT:
case SOUP_STATUS_CANT_CONNECT_PROXY:
@@ -193,6 +196,7 @@ wxgtk_webview_webkit_load_failed(WebKitWebView *,
case SOUP_STATUS_MALFORMED:
type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
+#endif
case SOUP_STATUS_BAD_REQUEST:
type = wxWEBVIEW_NAV_ERR_REQUEST;
--
2.43.0

View File

@@ -0,0 +1,16 @@
diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake
index 6bf28ca2e..5bd158e30 100644
--- a/deps/TBB/TBB.cmake
+++ b/deps/TBB/TBB.cmake
@@ -1,8 +1,10 @@
+set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake cmake/compilers/GNU.cmake)
+
orcaslicer_add_cmake_project(
TBB
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
- #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch
+ PATCH_COMMAND ${_patch_command}
CMAKE_ARGS
-DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF

View File

@@ -0,0 +1,57 @@
From 504e2a789502b76cf2553124a777e32e08bfa15c Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 13 Dec 2023 12:38:11 +0100
Subject: [PATCH] Work-around ClipperLib/union_ declaration problem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[116/471] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o
FAILED: src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o
/run/ccache/bin/c++ -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_NO_LIB -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOCALE_NO_LIB -DBOOST_LOG_NO_LIB -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_NO_LIB -DHAVE_FREETYPE -DHAVE_OPENGL_EXT -DHAVE_XLIB -DLIBNEST2D_GEOMETRIES_libslic3r -DLIBNEST2D_OPTIMIZER_nlopt -DLIBNEST2D_STATIC -DLIBNEST2D_THREADING_tbb -DOCC_CONVERT_SIGNALS -DOPENVDB_OPENEXR_STATICLIB -DOPENVDB_STATICLIB -DSLIC3R_GUI -DTBB_USE_CAPTURED_EXCEPTION=0 -DUNICODE -DUSE_TBB -DWXINTL_NO_GETTEXT_MACRO -D_UNICODE -DwxNO_UNSAFE_WXSTRING_CONV -DwxUSE_UNICODE -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/run/build/BambuStudio/src -I/run/build/BambuStudio/build/src/platform -I/run/build/BambuStudio/src/libslic3r -I/run/build/BambuStudio/build/src/libslic3r -I/run/build/BambuStudio/deps/build/destdir/usr/local/include/opencascade -I/run/build/BambuStudio/src/libnest2d/include -I/run/build/BambuStudio/src/miniz -I/run/build/BambuStudio/src/glu-libtess/include -I/run/build/BambuStudio/src/clipper2/Clipper2Lib/include -isystem /run/build/BambuStudio/src/eigen -isystem /run/build/BambuStudio/src/libigl -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/boost-1_78 -isystem /run/build/BambuStudio/deps/build/destdir/usr/local/include/OpenEXR -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fext-numeric-literals -Wall -Wno-reorder -O3 -DNDEBUG -std=gnu++17 -fPIC -fsigned-char -Werror=return-type -Wno-ignored-attributes -Wno-unknown-pragmas -DOPENVDB_ABI_VERSION_NUMBER=8 -MD -MT src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -MF src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o.d -o src/libslic3r/CMakeFiles/libslic3r.dir/Format/svg.cpp.o -c /run/build/BambuStudio/src/libslic3r/Format/svg.cpp
/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:214:29: error: Path is not a member of Slic3r::ClipperLib; did you mean ClipperLib::Path?
214 | ClipperLib::Path pt_path;
| ^~~~
In file included from /run/build/BambuStudio/src/libslic3r/Format/svg.cpp:22:
/run/build/BambuStudio/src/clipper/clipper.hpp:113:31: note: ClipperLib::Path declared here
113 | typedef std::vector<IntPoint> Path;
| ^~~~
/run/build/BambuStudio/src/libslic3r/Format/svg.cpp:240:28: error: union_ was not declared in this scope; did you mean union?
240 | polygons = union_(polygons);
| ^~~~~~
| union
---
src/libslic3r/Format/svg.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libslic3r/Format/svg.cpp b/src/libslic3r/Format/svg.cpp
index 4a96274b99e4..ff895402255d 100644
--- a/src/libslic3r/Format/svg.cpp
+++ b/src/libslic3r/Format/svg.cpp
@@ -204,12 +204,14 @@ bool get_svg_profile(const char *path, std::vector<Element_Info> &element_infos,
path_line_points.push_back(profile_line_points);
}
+#if 0
if (shape->fill.gradient == nullptr) {
double scale_size = 1e6;
std::vector<std::vector<std::pair<gp_Pnt, gp_Pnt>>> new_path_line_points;
float stroke_width = shape->strokeWidth * scale_size;
Polygons polygons;
bool close_polygon = false;
+
for (int i = 0; i < path_line_points.size(); ++i) {
ClipperLib::Path pt_path;
for (auto line_point : path_line_points[i]) {
@@ -253,7 +255,7 @@ bool get_svg_profile(const char *path, std::vector<Element_Info> &element_infos,
path_line_points = new_path_line_points;
}
-
+#endif
// generate all profile curves
std::vector<TopoDS_Wire> wires;
int index = 0;
--
2.43.0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (MINGW)
set(TBB_LINK_DEF_FILE_FLAG "")
set(TBB_DEF_FILE_PREFIX "")
elseif (APPLE)
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
# For correct ucontext.h structures layout
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE)
else()
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
endif()
# Add -Wno-error=stringop-overflow to fix GCC 12+ build as suggested on https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035
set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=stringop-overflow)
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
# Depfile options (e.g. -MD) are inserted automatically in some cases.
# Don't add -MMD to avoid conflicts in such cases.
if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
set(TBB_MMD_FLAG -MMD)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
endif()
if (NOT MINGW)
set(TBB_COMMON_LINK_LIBS dl)
endif()
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(-Werror)
endif()
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
endif()
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
endif()
if (MINGW)
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
endif()
# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
if (NOT TBB_SANITIZE MATCHES "thread")
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
endif()
# Disable lto flag
set(TBB_IPO_COMPILE_FLAGS "")
set(TBB_IPO_LINK_FLAGS "")
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
set(TBB_OPENMP_FLAG -fopenmp)

View File

@@ -0,0 +1,26 @@
From 2ef88023ba3eb323f47af89d92ce14a41f311c9e Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 2 Jan 2024 00:55:20 +0100
Subject: [PATCH] Disable GstPlayer media player version
---
build/cmake/init.cmake | 3 ---
1 file changed, 3 deletions(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 5ba4b6165b45..1931277f11c8 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -501,9 +501,6 @@ if(wxUSE_GUI)
set(wxUSE_GSTREAMER ${GSTREAMER_FOUND})
set(wxUSE_GSTREAMER_PLAYER OFF)
- if(GSTREAMER_PLAYER_INCLUDE_DIRS)
- set(wxUSE_GSTREAMER_PLAYER ON)
- endif()
if(NOT GSTREAMER_FOUND)
message(WARNING "GStreamer not found, wxMediaCtrl won't be available")
--
2.43.0

View File

@@ -0,0 +1,45 @@
From d8dcacd96df849760b41fb71667379a81659dafc Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 19 Jan 2024 11:34:47 +0100
Subject: [PATCH] wayland: Downgrade runtime errors to warnings
---
src/wl_window.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/wl_window.c b/src/wl_window.c
index 985a57116816..19e5dac259d4 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -2163,8 +2163,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
int count, const GLFWimage* images)
{
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Setting window icon not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Setting window icon not supported\n");
}
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
@@ -2172,16 +2171,14 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
// A Wayland client is not aware of its position, so just warn and leave it
// as (0, 0)
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Window position retrieval not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Window position retrieval not supported\n");
}
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
{
// A Wayland client can not set its position, so just warn
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Window position setting not supported");
+ fprintf(stderr, "!!! Ignoring Wayland error: Window position setting not supported\n");
}
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
--
2.43.0

View File

@@ -0,0 +1,180 @@
diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake
index 18fee7c15..7b886e93d 100644
--- a/deps/CGAL/CGAL.cmake
+++ b/deps/CGAL/CGAL.cmake
@@ -5,7 +5,7 @@ orcaslicer_add_cmake_project(
# For whatever reason, this keeps downloading forever (repeats downloads if finished)
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
- DEPENDS dep_Boost dep_GMP dep_MPFR
+ DEPENDS dep_GMP dep_MPFR
)
include(GNUInstallDirs)
diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
index 02a07ffd3..70ba0dcd4 100644
--- a/deps/CMakeLists.txt
+++ b/deps/CMakeLists.txt
@@ -208,11 +208,6 @@ 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)
- set(PNG_PKG dep_PNG)
-endif ()
set(EXPAT_PKG "")
if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake)
@@ -220,13 +215,11 @@ if (NOT EXPAT_FOUND)
endif ()
set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time)
-include(Boost/Boost.cmake)
# The order of includes respects the dependencies between libraries
include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake)
-include(GLFW/GLFW.cmake)
include(OpenCSG/OpenCSG.cmake)
include(TBB/TBB.cmake)
@@ -241,33 +234,22 @@ include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake)
-include(OpenSSL/OpenSSL.cmake)
-
set(CURL_PKG "")
if (NOT CURL_FOUND)
include(CURL/CURL.cmake)
set(CURL_PKG dep_CURL)
endif ()
-include(JPEG/JPEG.cmake)
-include(TIFF/TIFF.cmake)
-include(wxWidgets/wxWidgets.cmake)
include(OCCT/OCCT.cmake)
-include(FREETYPE/FREETYPE.cmake)
set(_dep_list
- dep_Boost
dep_TBB
${CURL_PKG}
- dep_wxWidgets
dep_Cereal
dep_NLopt
dep_OpenVDB
dep_OpenCSG
dep_CGAL
- dep_OpenSSL
- dep_GLFW
- ${PNG_PKG}
${ZLIB_PKG}
${EXPAT_PKG}
)
@@ -282,7 +264,6 @@ else()
endif()
list(APPEND _dep_list "dep_OCCT")
-list(APPEND _dep_list "dep_FREETYPE")
add_custom_target(deps ALL DEPENDS ${_dep_list})
diff --git a/deps/CURL/CURL.cmake b/deps/CURL/CURL.cmake
index 9846c7c9c..b5d924e6f 100644
--- a/deps/CURL/CURL.cmake
+++ b/deps/CURL/CURL.cmake
@@ -72,10 +72,6 @@ orcaslicer_add_cmake_project(CURL
${_curl_platform_flags}
)
-# if (APPLE OR (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
- add_dependencies(dep_CURL dep_OpenSSL)
-# endif ()
-
if (MSVC)
add_debug_dep(dep_CURL)
endif ()
diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake
index 541412b1c..363a9dda2 100644
--- a/deps/OCCT/OCCT.cmake
+++ b/deps/OCCT/OCCT.cmake
@@ -14,7 +14,6 @@ orcaslicer_add_cmake_project(OCCT
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost
- #DEPENDS dep_FREETYPE
CMAKE_ARGS
-DBUILD_LIBRARY_TYPE=${library_build_type}
-DUSE_TK=OFF
@@ -30,5 +29,3 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_ModelingData=OFF
-DBUILD_MODULE_Visualization=OFF
)
-
-add_dependencies(dep_OCCT dep_FREETYPE)
diff --git a/deps/OpenVDB/OpenVDB.cmake b/deps/OpenVDB/OpenVDB.cmake
index 7080b8b5d..e8b3695b2 100644
--- a/deps/OpenVDB/OpenVDB.cmake
+++ b/deps/OpenVDB/OpenVDB.cmake
@@ -10,7 +10,7 @@ orcaslicer_add_cmake_project(OpenVDB
# support vs2022, update to 8.2
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
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
@@ -34,4 +34,4 @@ if (MSVC)
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
-endif ()
\ No newline at end of file
+endif ()
diff --git a/deps/TIFF/TIFF.cmake b/deps/TIFF/TIFF.cmake
index b9c004d65..f74775a9d 100644
--- a/deps/TIFF/TIFF.cmake
+++ b/deps/TIFF/TIFF.cmake
@@ -5,7 +5,7 @@ if (APPLE)
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
+ DEPENDS ${ZLIB_PKG} ${PNG_PKG}
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
@@ -17,7 +17,7 @@ else()
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip
URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32
- DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
+ DEPENDS ${ZLIB_PKG} ${PNG_PKG}
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake
index 50cf991a6..31f039bd8 100644
--- a/deps/wxWidgets/wxWidgets.cmake
+++ b/deps/wxWidgets/wxWidgets.cmake
@@ -31,7 +31,7 @@ orcaslicer_add_cmake_project(
GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets"
GIT_TAG ${_wx_git_tag}
PATCH_COMMAND ${_patch_cmd}
- DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG
+ DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG}
CMAKE_ARGS
-DwxBUILD_PRECOMP=ON
${_wx_toolkit}
@@ -62,4 +62,4 @@ orcaslicer_add_cmake_project(
if (MSVC)
add_debug_dep(dep_wxWidgets)
-endif ()
\ No newline at end of file
+endif ()

View File

@@ -0,0 +1,166 @@
From 28f59e8900c3a54d4fe6bce43f62d1c4b0070e2c Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
Date: Mon, 11 Oct 2021 12:43:52 -0400
Subject: [PATCH] cmake: also link with GLU when using EGL
Fixes #19282
---
build/cmake/init.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index e1426afd428f..d5ecda9c98de 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -411,7 +411,7 @@ if(wxUSE_GUI)
else()
find_package(OpenGL)
if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL)
- set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::EGL)
+ set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::GLU OpenGL::EGL)
find_package(WAYLANDEGL)
if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND)
list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
--
2.43.0
From 0d6485797e23b5df5dded689fd63c86e3149abc9 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 29 Apr 2021 21:39:15 +0200
Subject: [PATCH 1/4] CMake: don't define WXUSINGDLL in wx-config for static
library
---
build/cmake/config.cmake | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 91d11acba206..98b505cbef28 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -153,10 +153,14 @@ function(wx_write_config)
set(WXCONFIG_CFLAGS "-pthread")
set(WXCONFIG_LDFLAGS "-pthread")
endif()
- set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL")
+ set(WXCONFIG_CPPFLAGS)
+ if(wxBUILD_SHARED)
+ wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL")
+ endif()
foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS)
wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}")
endforeach()
+ string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS)
set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS})
set(WXCONFIG_LDFLAGS_GUI)
set(WXCONFIG_RESFLAGS)
--
2.43.0
From ea6049598d806023cd7157600942ed78b719b74f Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Thu, 29 Apr 2021 21:41:06 +0200
Subject: [PATCH 2/4] CMake: add '-l' prefix to all library dependencies
---
build/cmake/config.cmake | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index 98b505cbef28..d5ec8cf4fbad 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -39,11 +39,10 @@ macro(wx_get_dependencies var lib)
else()
get_target_property(dep_name ${dep} OUTPUT_NAME)
endif()
- set(dep_name "-l${dep_name}")
else()
get_filename_component(dep_name ${dep} NAME)
endif()
- wx_string_append(${var} "${dep_name} ")
+ wx_string_append(${var} "-l${dep_name} ")
endforeach()
string(STRIP ${${var}} ${var})
endif()
--
2.43.0
From 4fae03bdd774b65211d6515104305d1993179eb3 Mon Sep 17 00:00:00 2001
From: Maarten Bent <MaartenBent@users.noreply.github.com>
Date: Tue, 4 May 2021 21:30:29 +0200
Subject: [PATCH 3/4] CMake: Improve adding external libraries to wx-config
Don't add -l to libraries already containing it (for example -lpthread).
Change libraries with format libName.so or libName.a to -lName,
configure also uses -l for these libraries. Account for possible invalid
libraries (Name-NOTFOUND) which could happen with imported libraries,
for example OpenGL::OpenGL.
Closes https://github.com/wxWidgets/wxWidgets/pull/2359
---
build/cmake/config.cmake | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake
index d5ec8cf4fbad..c2aa026ef059 100644
--- a/build/cmake/config.cmake
+++ b/build/cmake/config.cmake
@@ -42,7 +42,13 @@ macro(wx_get_dependencies var lib)
else()
get_filename_component(dep_name ${dep} NAME)
endif()
- wx_string_append(${var} "-l${dep_name} ")
+ if(dep_name MATCHES "^-l(.*)" OR dep_name STREQUAL "libc.so")
+ wx_string_append(${var} "${dep_name} ")
+ elseif(dep_name MATCHES "^lib(.*)(.so|.a)")
+ wx_string_append(${var} "-l${CMAKE_MATCH_1} ")
+ elseif(dep_name)
+ wx_string_append(${var} "-l${dep_name} ")
+ endif()
endforeach()
string(STRIP ${${var}} ${var})
endif()
--
2.43.0
From 8455b3a48baf73e91f34ac9301642832aec9b544 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 25 Aug 2021 23:31:45 +0200
Subject: [PATCH 4/4] Fix wx-config --libs output for static monolithic build
Include all extra libraries we need (except for OpenGL ones, as there is
still a separate library for it, even in monolithic build) in wx-config
--libs output for static monolithic build as the application (may) need
all of them, as all the libraries are part of the single monolithic one
in this case.
It seems that we had an attempt to fix this as far back as in 5719eab2bf
(Fix missing 3rd party builtin libs for static monolithic builds.,
2006-09-17), but it was insufficient as it didn't take the dependencies
of the other GUI libraries (e.g. "media") into account.
Closes #19175.
---
wx-config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wx-config.in b/wx-config.in
index 441f88ce9203..e3f7d115bbbd 100755
--- a/wx-config.in
+++ b/wx-config.in
@@ -1218,7 +1218,7 @@ if is_monolithic; then
# We still need the core lib deps for a static build though
if is_static; then
link_deps="${libdir}/libwx_@TOOLCHAIN_NAME@.a"
- wx_libs="$wx_libs $link_deps $ldlibs_core $ldlibs_base"
+ wx_libs="$wx_libs $link_deps $ldlibs_html $ldlibs_media $ldlibs_stc $ldlibs_webview $ldlibs_core $ldlibs_xml $ldlibs_base"
else
wx_libs="$wx_libs -lwx_@TOOLCHAIN_NAME@"
fi
--
2.43.0