diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 52ea9be081..5998dd6eb7 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -414,6 +414,11 @@ target_link_libraries(libslic3r qoi ) +if (APPLE) + # TODO: we need to fix notarization with the separate shared library + target_link_libraries(libslic3r OCCTWrapper) +endif () + if (TARGET OpenVDB::openvdb) target_link_libraries(libslic3r OpenVDB::openvdb) endif() diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index b816619223..8ac3e8adb2 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -21,6 +21,10 @@ namespace Slic3r { +#if __APPLE__ +extern "C" bool load_step_internal(const char *path, OCCTResult* res); +#endif + LoadStepFn get_load_step_fn() { static LoadStepFn load_step_fn = nullptr; @@ -47,6 +51,8 @@ LoadStepFn get_load_step_fn() FreeLibrary(module); throw; } +#elif __APPLE__ + load_step_fn = &load_step_internal; #else libpath /= "OCCTWrapper.so"; void *plugin_ptr = dlopen(libpath.c_str(), RTLD_NOW | RTLD_GLOBAL); diff --git a/src/occt_wrapper/CMakeLists.txt b/src/occt_wrapper/CMakeLists.txt index 9f4989b72f..ed75531a96 100644 --- a/src/occt_wrapper/CMakeLists.txt +++ b/src/occt_wrapper/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 3.13) project(OCCTWrapper) -add_library(OCCTWrapper MODULE OCCTWrapper.cpp) +if (APPLE) + # TODO: we need to fix notarization with the separate shared library + add_library(OCCTWrapper STATIC OCCTWrapper.cpp) +else () + add_library(OCCTWrapper MODULE OCCTWrapper.cpp) +endif () set_target_properties(OCCTWrapper PROPERTIES