From de55a60bf541c2d125373131b9d82cd0c511a064 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 26 Oct 2018 18:08:43 +0200 Subject: [PATCH] Added /bigobj (Increase Number of Sections in .Obj file) Fixed external declaration of slic3r_main() --- CMakeLists.txt | 8 ++++++-- src/slic3r_app_msvc.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbad4ca23..f4d1223fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,12 @@ option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1) option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1) option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0) -if (MSVC AND SLIC3R_MSVC_COMPILE_PARALLEL) - add_compile_options(/MP) +if (MSVC) + if (SLIC3R_MSVC_COMPILE_PARALLEL) + add_compile_options(/MP) + endif () + # /bigobj (Increase Number of Sections in .Obj file) + add_compile_options(-bigobj) endif () # CMAKE_PREFIX_PATH is used to point CMake to the remaining dependencies (Boost, TBB, ...) diff --git a/src/slic3r_app_msvc.cpp b/src/slic3r_app_msvc.cpp index e82d1d322..46090727a 100644 --- a/src/slic3r_app_msvc.cpp +++ b/src/slic3r_app_msvc.cpp @@ -175,7 +175,10 @@ protected: } }; -typedef int (__stdcall *Slic3rMainFunc)(int argc, wchar_t **argv); +extern "C" { + typedef int (__stdcall *Slic3rMainFunc)(int argc, wchar_t **argv); + Slic3rMainFunc slic3r_main = nullptr; +} #ifdef SLIC3R_WRAPPER_NOCONSOLE int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpCmdLine, int nCmdShow) @@ -224,7 +227,7 @@ int wmain(int argc, wchar_t **argv) } // resolve function address here - Slic3rMainFunc slic3r_main = (Slic3rMainFunc)GetProcAddress(hInstance_Slic3r, "slic3r_main"); + slic3r_main = (Slic3rMainFunc)GetProcAddress(hInstance_Slic3r, "slic3r_main"); if (slic3r_main == nullptr) { printf("could not locate the function slic3r_main in slic3r.dll\n"); return -1;