File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed
Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.20)
22cmake_policy (SET CMP0091 NEW)
33project (libnest2d)
44find_package (standardprojectsettings REQUIRED)
5+ find_package (spdlog REQUIRED)
56
67option (BUILD_SHARED_LIBS "Build shared libs instead of static (applies for dependencies as well)" OFF )
78option (HEADER_ONLY "If enabled static library will not be built." ON )
@@ -55,7 +56,7 @@ target_compile_definitions(project_options INTERFACE LIBNEST2D_GEOMETRIES_${GEOM
5556
5657if ("${OPTIMIZER} " STREQUAL "nlopt" )
5758 find_package (NLopt REQUIRED)
58- target_link_libraries (project_options INTERFACE NLopt::nlopt)
59+ target_link_libraries (project_options INTERFACE NLopt::nlopt spdlog::spdlog )
5960 list (APPEND nest2d_HDRS
6061 include /libnest2d/optimizers/nlopt/simplex.hpp
6162 include /libnest2d/optimizers/nlopt/subplex.hpp
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ def layout(self):
8989 self .cpp .package .includedirs = ["include" ]
9090
9191 def requirements (self ):
92+ self .requires ("spdlog/[>=1.14.1]" , transitive_headers = True )
9293 if self .options .geometries == "clipper" :
9394 self .requires ("clipper/6.4.2@ultimaker/stable" , transitive_headers = True )
9495 if self .options .geometries == "boost" or self .options .geometries == "clipper" :
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ target_link_libraries(libnest2d_js PRIVATE Boost::headers)
3434target_link_libraries (libnest2d_js PRIVATE clipper::clipper)
3535
3636target_link_libraries (libnest2d_js PRIVATE NLopt::nlopt)
37+
38+ target_link_libraries (libnest2d_js PUBLIC spdlog::spdlog)
3739# Define backend macro for Emscripten
3840target_compile_definitions (libnest2d_js PRIVATE LIBNEST2D_GEOMETRIES_clipper)
3941target_compile_definitions (libnest2d_js PRIVATE LIBNEST2D_OPTIMIZER_nlopt)
@@ -51,7 +53,7 @@ target_link_options(libnest2d_js
5153 "SHELL:-s ERROR_ON_UNDEFINED_SYMBOLS=0"
5254 "SHELL:--bind"
5355 "SHELL:-l embind"
54- "SHELL: --embind- emit-tsd libnest2d_js.d.ts"
56+ "SHELL: --emit-tsd libnest2d_js.d.ts"
5557 "SHELL:-sWASM_BIGINT=1"
5658)
5759
Original file line number Diff line number Diff line change @@ -161,12 +161,12 @@ EMSCRIPTEN_BINDINGS(libnest2d_js) {
161161 // Item class
162162 class_<Item>(" Item" )
163163 .constructor <const PolygonImpl&>()
164- .class_function (" createFromVertices" , optional_override ([](const emscripten::val& jsVertices) -> Item* {
164+ .class_function (" createFromVertices" , optional_override ([](const emscripten::val& jsVertices) -> Item {
165165 std::vector<Point> vertices = jsArrayToPointVector (jsVertices);
166166 PolygonImpl polygon;
167167 polygon.Contour = vertices;
168- return new Item (polygon);
169- }), allow_raw_pointers () )
168+ return Item (polygon);
169+ }))
170170 .function (" binId" , select_overload<int () const >(&Item::binId))
171171 .function (" setBinId" , select_overload<void (int )>(&Item::binId))
172172 .function (" area" , &Item::area)
@@ -187,6 +187,7 @@ EMSCRIPTEN_BINDINGS(libnest2d_js) {
187187 return pointVectorToJSArray (poly.Contour );
188188 }));
189189
190+
190191 // Polygon class for internal type compatibility
191192 class_<Polygon>(" Polygon" );
192193
You can’t perform that action at this time.
0 commit comments