diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 270a7742c7..8e9a31f705 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,9 +99,6 @@ if(ORCA_TOOLS) endif() target_link_libraries(OrcaSlicer_profile_validator libslic3r boost_headeronly libcurl OpenSSL::SSL OpenSSL::Crypto) target_compile_definitions(OrcaSlicer_profile_validator PRIVATE -DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x602 -DBOOST_SYSTEM_USE_UTF8) - if(WIN32) - target_link_libraries(OrcaSlicer_profile_validator bcrypt.lib) - endif() endif() # Create a slic3r executable @@ -110,7 +107,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dev-utils/platform/msw/OrcaSlicer.rc. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dev-utils/platform/msw/OrcaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/OrcaSlicer.manifest @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dev-utils/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) if (WIN32) - add_library(OrcaSlicer SHARED OrcaSlicer.cpp OrcaSlicer.hpp dev-utils/BaseException.cpp dev-utils/BaseException.h dev-utils/StackWalker.cpp dev-utils/StackWalker.h) + add_library(OrcaSlicer SHARED OrcaSlicer.cpp OrcaSlicer.hpp) else () add_executable(OrcaSlicer OrcaSlicer.cpp OrcaSlicer.hpp) endif () diff --git a/src/dev-utils/BaseException.cpp b/src/dev-utils/BaseException.cpp index 9ca16080e3..6c7245b028 100644 --- a/src/dev-utils/BaseException.cpp +++ b/src/dev-utils/BaseException.cpp @@ -314,7 +314,7 @@ BOOL CBaseException::GetLogicalAddress( for (unsigned i = 0; i < pNtHdr->FileHeader.NumberOfSections; i++, pSection++ ) { DWORD sectionStart = pSection->VirtualAddress; - DWORD sectionEnd = sectionStart + max(pSection->SizeOfRawData, pSection->Misc.VirtualSize); + DWORD sectionEnd = sectionStart + std::max(pSection->SizeOfRawData, pSection->Misc.VirtualSize); if ( (rva >= sectionStart) && (rva <= sectionEnd) ) { diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index ccda6e17de..44e6d0878d 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -591,12 +591,12 @@ target_link_libraries(libslic3r TBB::tbb TBB::tbbmalloc ZLIB::ZLIB + OpenSSL::Crypto ) if(NOT WIN32) # Link freetype for OCCT dependency (CAD operations need font rendering) target_link_libraries(libslic3r PRIVATE ${FREETYPE_LIBRARIES}) - target_link_libraries(libslic3r PRIVATE OpenSSL::Crypto) if (NOT APPLE) target_link_libraries(libslic3r PRIVATE fontconfig) endif() @@ -613,7 +613,7 @@ if (TARGET OpenVDB::openvdb) endif() if(WIN32) - target_link_libraries(libslic3r PRIVATE Psapi.lib) + target_link_libraries(libslic3r PRIVATE Psapi.lib bcrypt.lib) endif() if(SLIC3R_PROFILE) diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 703509fb11..4ce5c67ede 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -675,7 +675,17 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GeneratedConfig.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/GeneratedConfig.hpp @ONLY) -add_library(libslic3r_gui STATIC ${SLIC3R_GUI_SOURCES}) +if (WIN32) + add_library(libslic3r_gui STATIC + ${SLIC3R_GUI_SOURCES} + ../dev-utils/BaseException.cpp + ../dev-utils/BaseException.h + ../dev-utils/StackWalker.cpp + ../dev-utils/StackWalker.h + ) +else () + add_library(libslic3r_gui STATIC ${SLIC3R_GUI_SOURCES}) +endif () target_include_directories(libslic3r_gui PRIVATE Utils ${CMAKE_CURRENT_BINARY_DIR}) if (WIN32) diff --git a/tests/fff_print/test_printgcode.cpp b/tests/fff_print/test_printgcode.cpp index 2a45bd2003..b2dbd68980 100644 --- a/tests/fff_print/test_printgcode.cpp +++ b/tests/fff_print/test_printgcode.cpp @@ -1,3 +1,13 @@ +#ifdef WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX +#define NOMINMAX +#endif + #include +#endif + #include #include "libslic3r/libslic3r.h" diff --git a/tests/libnest2d/CMakeLists.txt b/tests/libnest2d/CMakeLists.txt index 07bc8292b3..d345c6a195 100644 --- a/tests/libnest2d/CMakeLists.txt +++ b/tests/libnest2d/CMakeLists.txt @@ -3,5 +3,15 @@ add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests_main.cpp printer_parts.cp target_link_libraries(${_TEST_NAME}_tests test_common libnest2d ) set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests") +if (WIN32) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug) + elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_Release) + else() + orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release) + endif() +endif() + catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ") # add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "${CATCH_EXTRA_ARGS} exclude:[NotWorking]") diff --git a/tests/libslic3r/test_marchingsquares.cpp b/tests/libslic3r/test_marchingsquares.cpp index db427a8d70..7af425ec0e 100644 --- a/tests/libslic3r/test_marchingsquares.cpp +++ b/tests/libslic3r/test_marchingsquares.cpp @@ -489,7 +489,7 @@ static constexpr float gsizef = 100.0; // grid size in mm (box volume side leng static constexpr float wsizef = 0.50; // grid window size in mm (roughly line segment length). static constexpr float psizef = 0.01; // raster pixel size in mm (roughly point accuracy). static constexpr float isoval = 0.0; // iso value threshold to use. -static constexpr size_t wsize = std::round(wsizef / psizef); +static const long wsize = std::round(wsizef / psizef); static float period = 10.0; // gyroid "wavelength" in mm (2x line spacing). static float freq = 2 * PI / period; // gyroid frequency in waves per mm. diff --git a/tests/slic3rutils/slic3rutils_tests_main.cpp b/tests/slic3rutils/slic3rutils_tests_main.cpp index f0a9285c2f..ae4e13516a 100644 --- a/tests/slic3rutils/slic3rutils_tests_main.cpp +++ b/tests/slic3rutils/slic3rutils_tests_main.cpp @@ -21,7 +21,7 @@ TEST_CASE("Check SSL certificates paths", "[Http][NotWorking]") { } TEST_CASE("Http digest authentication", "[Http][NotWorking]") { - Slic3r::Http g = Slic3r::Http::get("https://httpbin.org/digest-auth/guest/guest"); + Slic3r::Http g = Slic3r::Http::get("https://httpbin.org/digest-auth/auth/guest/guest"); g.auth_digest("guest", "guest");